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 <bfields@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
J. Bruce Fields
2016-11-25 20:39:39 -05:00
committed by Eryu Guan
parent 0240a9c12f
commit 64ea47a87e
+6 -4
View 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;
}