mirror of
git://git.sv.gnu.org/findutils.git
synced 2026-02-01 14:19:00 +01:00
find: ignore more vanished entries with -ignore_readdir_race
Reproducer: # Spin up lots of short-living processes. $ while env true; do sleep .001; done & # Invoke 'find' on the /proc file system; # this pretty reliably gives the following error: $ find /proc -ignore_readdir_race -maxdepth 3 > /dev/null find: '/proc/845078': No such file or directory * find/ftsfind.c (consider_visiting): Return when FTS returned ENOENT with the option -ignore_readdir_race. * NEWS (Bug Fixes): Mention the fix. Fixes https://savannah.gnu.org/bugs/?45930
This commit is contained in:
5
NEWS
5
NEWS
@@ -2,6 +2,11 @@ GNU findutils NEWS - User visible changes. -*- outline -*- (allout)
|
||||
|
||||
* Noteworthy changes in release ?.? (????-??-??) [?]
|
||||
|
||||
** Bug Fixes
|
||||
|
||||
'find -ignore_readdir_race' now has a race between FTS read and the visiting
|
||||
of the entry when the file was removed. [#45930]
|
||||
|
||||
** Documentation Changes
|
||||
|
||||
The forthcoming Issue 8 of the POSIX standard will standardise "find
|
||||
|
||||
@@ -355,6 +355,10 @@ consider_visiting (FTS *p, FTSENT *ent)
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Ignore unlink() error for vanished files. */
|
||||
if (ENOENT == ent->fts_errno && options.ignore_readdir_race)
|
||||
return;
|
||||
|
||||
nonfatal_target_file_error (ent->fts_errno, ent->fts_path);
|
||||
/* Continue despite the error, as file name without stat info
|
||||
* might be better than not even processing the file name. This
|
||||
|
||||
Reference in New Issue
Block a user