From: "J. Bruce Fields" <bfields@redhat.com>
To: trondmy@kernel.org
Cc: linux-nfs@vger.kernel.org, Chuck Lever <chuck.lever@oracle.com>
Subject: Re: [PATCH] NFS: fix nfs_fetch_iversion()
Date: Wed, 24 Mar 2021 17:23:39 -0400 [thread overview]
Message-ID: <YFut25Sq1wvv8Zii@pick.fieldses.org> (raw)
In-Reply-To: <20210324195353.577432-1-trondmy@kernel.org>
On Wed, Mar 24, 2021 at 03:53:53PM -0400, trondmy@kernel.org wrote:
> From: Trond Myklebust <trond.myklebust@hammerspace.com>
>
> The change attribute is always set by all NFS client versions so get rid
> of the open-coded version.
Thanks!
I'm unclear whether there's a user-visible bug here or whether it's
mainly cleanup?
--b.
> Fixes: 3cc55f4434b4 ("nfs: use change attribute for NFS re-exports")
> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
> ---
> fs/nfs/export.c | 15 ++++-----------
> 1 file changed, 4 insertions(+), 11 deletions(-)
>
> diff --git a/fs/nfs/export.c b/fs/nfs/export.c
> index f2b34cfe286c..b347e3ce0cc8 100644
> --- a/fs/nfs/export.c
> +++ b/fs/nfs/export.c
> @@ -171,17 +171,10 @@ static u64 nfs_fetch_iversion(struct inode *inode)
> {
> struct nfs_server *server = NFS_SERVER(inode);
>
> - /* Is this the right call?: */
> - nfs_revalidate_inode(server, inode);
> - /*
> - * Also, note we're ignoring any returned error. That seems to be
> - * the practice for cache consistency information elsewhere in
> - * the server, but I'm not sure why.
> - */
> - if (server->nfs_client->rpc_ops->version >= 4)
> - return inode_peek_iversion_raw(inode);
> - else
> - return time_to_chattr(&inode->i_ctime);
> + if (nfs_check_cache_invalid(inode, NFS_INO_INVALID_CHANGE |
> + NFS_INO_REVAL_PAGECACHE))
> + __nfs_revalidate_inode(server, inode);
> + return inode_peek_iversion_raw(inode);
> }
>
> const struct export_operations nfs_export_ops = {
> --
> 2.30.2
>
next prev parent reply other threads:[~2021-03-24 21:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-24 19:53 [PATCH] NFS: fix nfs_fetch_iversion() trondmy
2021-03-24 21:23 ` J. Bruce Fields [this message]
2021-03-25 1:39 ` Trond Myklebust
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=YFut25Sq1wvv8Zii@pick.fieldses.org \
--to=bfields@redhat.com \
--cc=chuck.lever@oracle.com \
--cc=linux-nfs@vger.kernel.org \
--cc=trondmy@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