Follow-up Comment #4, bug #54913 (project findutils): What a pity: that code - to use the D_TYPE returned from gnulib's FTS - has been added to avoid an extra stat() when getdents() already returns it: https://git.sv.gnu.org/cgit/findutils.git/commit/?id=acb82fe
[adding Jim as the patch author] The fix would be to undo this: --- a/find/ftsfind.c +++ b/find/ftsfind.c @@ -579,8 +579,9 @@ find (char *arg) state.already_issued_stat_error_msg = false; state.have_stat = false; - state.have_type = !!ent->fts_statp->st_mode; - state.type = state.have_type ? ent->fts_statp->st_mode : 0; + state.have_type = false; + state.type = 0; + consider_visiting (p, ent); } /* fts_read returned NULL; distinguish between "finished" and "error". */ ... but to the cost of performance again, because FTS usually returns FTS_NSOK for all non-directory files (see "find -D search"). E.g. on NFS, that extra stat() would be quite slow ... and only needed for that quite special and therefore seldom case of bind-mounts. The only alternative I can currently think of is to check the mountlist for the given ent->fts_path before not taking over the FTS information. Any other idea to avoid the performance punishment? _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?54913> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/