All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Eryu Guan <eguan@redhat.com>
Cc: Andreas Dilger <adilger@dilger.ca>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	fstests@vger.kernel.org,
	Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: [PATCH 2/2] dirstress: Allow ESTALE as well as ENOENT
Date: Fri, 25 Nov 2016 20:39:39 -0500	[thread overview]
Message-ID: <20161126013939.GB32632@fieldses.org> (raw)
In-Reply-To: <20161126013901.GA32632@fieldses.org>

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(-)

diff --git a/src/dirstress.c b/src/dirstress.c
index f8f73553a1bc..33a166c51819 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-26  1:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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         ` J. Bruce Fields [this message]
2016-11-29  6:43           ` [PATCH 2/2] dirstress: Allow ESTALE as well as ENOENT 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=20161126013939.GB32632@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=adilger@dilger.ca \
    --cc=eguan@redhat.com \
    --cc=fstests@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.