From: Chuck Lever <chuck.lever@oracle.com>
To: Jeff Layton <jlayton@kernel.org>
Cc: Neil Brown <neilb@suse.de>, Olga Kornievskaia <kolga@netapp.com>,
Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>,
linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC] nfsd: set missing after_change as before_change + 1
Date: Mon, 24 Jul 2023 11:20:48 -0400 [thread overview]
Message-ID: <ZL6W0GqBSdlvVL2Y@tissot.1015granger.net> (raw)
In-Reply-To: <20230724-bz2223560-v1-1-b6da868c0fc6@kernel.org>
On Mon, Jul 24, 2023 at 10:53:39AM -0400, Jeff Layton wrote:
> In the event that we can't fetch post_op_attr attributes, we still need
> to set a value for the after_change. The operation has already happened,
> so we're not able to return an error at that point, but we do want to
> ensure that the client knows that its cache should be invalidated.
>
> If we weren't able to fetch post-op attrs, then just set the
> after_change to before_change + 1. The atomic flag should already be
> clear in this case.
>
> Suggested-by: Neil Brown <neilb@suse.de>
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
> fs/nfsd/nfs4proc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
I'm not sure this change makes any difference. The client would
possibly see the change value move forward then back. I'd think a
false "atomic" field and using the /same/ pre- and post-change would
be safer...?
But I'm intrigued enough to apply this to nfsd-next provisionally,
at least for testing and further review. It will appear a little
later today.
> diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
> index 3f6710c9c5c9..f0f318e78630 100644
> --- a/fs/nfsd/nfs4proc.c
> +++ b/fs/nfsd/nfs4proc.c
> @@ -411,7 +411,7 @@ set_change_info(struct nfsd4_change_info *cinfo, struct svc_fh *fhp)
> if (WARN_ON_ONCE(!fhp->fh_pre_saved))
> cinfo->before_change = 0;
> if (!fhp->fh_post_saved)
> - cinfo->after_change = 0;
> + cinfo->after_change = cinfo->before_change + 1;
> }
>
> static __be32
>
> ---
> base-commit: 97a5d0146ef443df148805a4e9c3c44111f14ab1
> change-id: 20230724-bz2223560-5ed6bc3a5db7
>
> Best regards,
> --
> Jeff Layton <jlayton@kernel.org>
>
--
Chuck Lever
next prev parent reply other threads:[~2023-07-24 15:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-24 14:53 Jeff Layton
2023-07-24 15:20 ` Chuck Lever [this message]
2023-07-24 16:21 ` Jeff Layton
2023-07-24 16:44 ` Chuck Lever III
2023-07-24 23:15 ` NeilBrown
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=ZL6W0GqBSdlvVL2Y@tissot.1015granger.net \
--to=chuck.lever@oracle.com \
--cc=Dai.Ngo@oracle.com \
--cc=jlayton@kernel.org \
--cc=kolga@netapp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neilb@suse.de \
--cc=tom@talpey.com \
/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
all inboxes | Powered by JetHome®