From: Trond Myklebust <trondmy@hammerspace.com>
To: "mszeredi@redhat.com" <mszeredi@redhat.com>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>
Cc: "amir73il@gmail.com" <amir73il@gmail.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"adilger@dilger.ca" <adilger@dilger.ca>,
"mtk.manpages@gmail.com" <mtk.manpages@gmail.com>,
"fw@deneb.enyo.de" <fw@deneb.enyo.de>,
"linux-api@vger.kernel.org" <linux-api@vger.kernel.org>,
"dhowells@redhat.com" <dhowells@redhat.com>
Subject: Re: [PATCH v2 5/5] nfs: don't clear STATX_ATIME from result_mask
Date: Fri, 19 Oct 2018 15:52:37 +0000 [thread overview]
Message-ID: <2ca365ec330cf918188e8c47b26e741073382d9d.camel@primarydata.com> (raw)
In-Reply-To: <20181019122049.27121-5-mszeredi@redhat.com>
On Fri, 2018-10-19 at 14:20 +0200, Miklos Szeredi wrote:
> As per statx(2) man page only clear out flags that are unsupported by
> the
> fs or have an unrepresentable value. Atime is supported by NFS as
> long as
> it's supported on the server.
>
> So the STATX_ATIME flag should not be cleared in the result_mask if
> the
> operation was requested on a MNT_NOATIME or MNT_NODIRATIME mount.
>
> This patch doesn't change the revalidation algorithm in any way, just
> the
> clearing of flags in stat->result_mask.
>
> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
> Fixes: 9ccee940bd5b ("Support statx() mask and query flags
> parameters")
> Cc: Trond Myklebust <trond.myklebust@primarydata.com>
> ---
> fs/nfs/inode.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
> index b65aee481d13..34bb3e591709 100644
> --- a/fs/nfs/inode.c
> +++ b/fs/nfs/inode.c
> @@ -811,7 +811,7 @@ int nfs_getattr(const struct path *path, struct
> kstat *stat,
> if (!(request_mask &
> (STATX_MODE|STATX_NLINK|STATX_ATIME|STATX_CTIME|
> STATX_MTIME|STATX_UID|STATX_GID
> |
> STATX_SIZE|STATX_BLOCKS)))
> - goto out_no_revalidate;
> + goto out_no_update;
>
> /* Check whether the cached attributes are stale */
> do_update |= force_sync || nfs_attribute_cache_expired(inode);
> @@ -833,9 +833,6 @@ int nfs_getattr(const struct path *path, struct
> kstat *stat,
> goto out;
> } else
> nfs_readdirplus_parent_cache_hit(path->dentry);
> -out_no_revalidate:
> - /* Only return attributes that were revalidated. */
> - stat->result_mask &= request_mask;
> out_no_update:
> generic_fillattr(inode, stat);
> stat->ino = nfs_compat_user_ino64(NFS_FILEID(inode));
NACK.
When we don't revalidate the attribute, then the content of the field
contains junk values. The above code is very intentional.
--
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com
next prev parent reply other threads:[~2018-10-19 15:52 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-19 12:20 [PATCH v2 1/5] orangefs: fix request_mask misuse Miklos Szeredi
2018-10-19 12:20 ` [PATCH v2 2/5] uapi: deprecate STATX_ALL Miklos Szeredi
2018-10-19 12:20 ` [PATCH v2 3/5] statx: add STATX_ATTRIBUTES flag Miklos Szeredi
2018-10-19 12:20 ` [PATCH v2 4/5] statx: don't clear STATX_ATIME on SB_RDONLY Miklos Szeredi
2018-10-19 12:20 ` [PATCH v2 5/5] nfs: don't clear STATX_ATIME from result_mask Miklos Szeredi
2018-10-19 15:52 ` Trond Myklebust [this message]
2018-10-19 17:46 ` Miklos Szeredi
2018-10-19 18:14 ` Trond Myklebust
2018-10-19 20:48 ` Miklos Szeredi
2018-10-20 17:46 ` Trond Myklebust
2018-11-05 22:29 ` Andreas Dilger
2018-10-19 14:27 ` [PATCH v2 1/5] orangefs: fix request_mask misuse Andreas Dilger
2018-10-19 15:35 ` [PATCH v2 2/5] uapi: deprecate STATX_ALL David Howells
2018-10-19 15:40 ` Miklos Szeredi
2018-10-19 15:47 ` David Howells
2018-10-19 17:30 ` Miklos Szeredi
2018-10-19 15:36 ` [PATCH v2 3/5] statx: add STATX_ATTRIBUTES flag David Howells
2018-10-19 15:40 ` [PATCH v2 4/5] statx: don't clear STATX_ATIME on SB_RDONLY David Howells
2018-10-19 15:44 ` [PATCH v2 5/5] nfs: don't clear STATX_ATIME from result_mask David Howells
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=2ca365ec330cf918188e8c47b26e741073382d9d.camel@primarydata.com \
--to=trondmy@hammerspace.com \
--cc=adilger@dilger.ca \
--cc=amir73il@gmail.com \
--cc=dhowells@redhat.com \
--cc=fw@deneb.enyo.de \
--cc=linux-api@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mszeredi@redhat.com \
--cc=mtk.manpages@gmail.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;
as well as URLs for NNTP newsgroup(s).