linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eryu Guan <eguan@redhat.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
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: Re: [PATCH 2/2] dirstress: Allow ESTALE as well as ENOENT
Date: Tue, 29 Nov 2016 14:43:06 +0800	[thread overview]
Message-ID: <20161129064306.GL22989@eguan.usersys.redhat.com> (raw)
In-Reply-To: <20161126013939.GB32632@fieldses.org>

On Fri, Nov 25, 2016 at 08:39:39PM -0500, J. Bruce Fields wrote:
> 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)) {
                                                         ^^^ this should be ==
>  			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)) {
                                                         ^^^ same here

I can fix them at commit time, no resend is needed.

Thanks,
Eryu

>  			return 0;
>  		}
>  
> -- 
> 2.9.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2016-11-29  6:43 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         ` [PATCH 2/2] dirstress: Allow ESTALE as well as ENOENT J. Bruce Fields
2016-11-29  6:43           ` Eryu Guan [this message]
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=20161129064306.GL22989@eguan.usersys.redhat.com \
    --to=eguan@redhat.com \
    --cc=adilger@dilger.ca \
    --cc=bfields@fieldses.org \
    --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 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).