linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: bfields@fieldses.org (J. Bruce Fields)
To: linux-fsdevel@vger.kernel.org
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH xfstests] dirstress: Allow ESTALE as well as ENOENT
Date: Wed, 23 Nov 2016 17:20:54 -0500	[thread overview]
Message-ID: <20161123222054.GA7900@fieldses.org> (raw)

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


             reply	other threads:[~2016-11-23 22:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-23 22:20 J. Bruce Fields [this message]
2016-11-23 23:19 ` [PATCH xfstests] dirstress: Allow ESTALE as well as ENOENT 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161123222054.GA7900@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).