linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH xfstests] dirstress: Allow ESTALE as well as ENOENT
@ 2016-11-23 22:20 J. Bruce Fields
  2016-11-23 23:19 ` Andreas Dilger
  0 siblings, 1 reply; 8+ messages in thread
From: J. Bruce Fields @ 2016-11-23 22:20 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: linux-nfs

From: "J. Bruce Fields" <bfields@redhat.com>

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>
---
 src/dirstress.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

Sorry, who do xfstests patches go to?--b.

diff --git a/src/dirstress.c b/src/dirstress.c
index f8f7355..33a166c 100644
--- a/src/dirstress.c
+++ b/src/dirstress.c
@@ -203,8 +203,10 @@ 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 +226,10 @@ 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;
 		}
 
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-11-29 14:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-23 22:20 [PATCH xfstests] dirstress: Allow ESTALE as well as ENOENT J. Bruce Fields
2016-11-23 23:19 ` Andreas Dilger
2016-11-25  3:47   ` J. Bruce Fields
2016-11-25 11:35     ` Eryu Guan
2016-11-26  1:39       ` [PATCH 1/2] Document fstests mailing list J. Bruce Fields
2016-11-26  1:39         ` [PATCH 2/2] dirstress: Allow ESTALE as well as ENOENT J. Bruce Fields
2016-11-29  6:43           ` Eryu Guan
2016-11-29 14:34             ` J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).