From: J. Bruce Fields Date: Sat, 26 Nov 2016 01:39:39 +0000 (-0500) Subject: src/dirstress: Allow ESTALE as well as ENOENT X-Git-Tag: v2022.05.01~2287 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=64ea47a87e9a58c0c1405d093a01cc4fb6132e56;p=users%2Fhch%2Fxfstests-dev.git src/dirstress: Allow ESTALE as well as ENOENT In the NFS case an attempt to chdir out of a removed directory could result in ESTALE, and that should not cause the test to fail. This was causing intermittent failures on generic/011 on NFS. Signed-off-by: J. Bruce Fields Reviewed-by: Eryu Guan Signed-off-by: Eryu Guan --- diff --git a/src/dirstress.c b/src/dirstress.c index f8f73553a..b70e6b88b 100644 --- a/src/dirstress.c +++ b/src/dirstress.c @@ -203,8 +203,9 @@ dirstress( if (verbose) fprintf(stderr,"** [%d] chdir ..\n", pid); error = chdir(".."); if (error) { - /* If this is multithreaded, then expecting a ENOENT here is fine */ - if (nprocs_per_dir > 1 && errno == ENOENT) { + /* If this is multithreaded, then expecting a ENOENT here is fine, + * and ESTALE is normal in the NFS case. */ + if (nprocs_per_dir > 1 && (errno == ENOENT || errno == ESTALE)) { return 0; } @@ -224,8 +225,9 @@ dirstress( if (verbose) fprintf(stderr,"** [%d] chdir ..\n", pid); error = chdir(".."); if (error) { - /* If this is multithreaded, then expecting a ENOENT here is fine */ - if (nprocs_per_dir > 1 && errno == ENOENT) { + /* If this is multithreaded, then expecting a ENOENT here is fine, + * and ESTALE is normal in the NFS case. */ + if (nprocs_per_dir > 1 && (errno == ENOENT || errno == ESTALE)) { return 0; }