]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
src/dirstress: Allow ESTALE as well as ENOENT
authorJ. Bruce Fields <bfields@redhat.com>
Sat, 26 Nov 2016 01:39:39 +0000 (20:39 -0500)
committerEryu Guan <eguan@redhat.com>
Tue, 29 Nov 2016 06:39:29 +0000 (14:39 +0800)
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 <bfields@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
src/dirstress.c

index f8f73553a1bc621b8f99789946c6736706e2831f..b70e6b88b9480bb00cd9f14fb436977a2f208a1a 100644 (file)
@@ -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;
                }