Files
findutils/doc
Bernhard Voelker 0afb2efada find: make -delete honour the -ignore_readdir_race option
* find/pred.c (pred_delete): Return true when the -ignore_readdir_race
option is active and unlinkat() came back with ENOENT.
* doc/find.texi (Option -ignore_readdir_race): Document the change.
(Action -delete): Likewise.
* find/find.1: Likewise.
* NEWS (Bug Fixes): Mention the fix.

For now, it seems a bit hard to add a proper test for this,
so the following shell snippet demonstrates the race:

  $ seq 10 | xargs touch
  $ env time -f 'find exit status: %x\nfind time: %e' \
      find -ignore_readdir_race -type f \
        -delete \
        -exec sh -c 'sleep $(basename {})' \; \
        -printf 'find deleted: %p\n' \
        & \
    sleep 20; \
    seq 10 | xargs rm -fv; \
    wait $!

Reported by Alexander Golubev in
https://savannah.gnu.org/bugs/?52981
2018-03-14 20:44:14 +01:00
..