From: martin@omnibond.com
To: Miklos Szeredi <mszeredi@redhat.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-api@vger.kernel.org, David Howells <dhowells@redhat.com>,
Michael Kerrisk <mtk.manpages@gmail.com>,
Andreas Dilger <adilger@dilger.ca>,
Florian Weimer <fw@deneb.enyo.de>,
Amir Goldstein <amir73il@gmail.com>,
Mike Marshall <hubcap@omnibond.com>
Subject: Re: [PATCH 1/3] orangefs: fix request_mask misuse
Date: Thu, 18 Oct 2018 17:45:17 -0400 [thread overview]
Message-ID: <20181018214517.GA44581@t480s.mkb.name> (raw)
In-Reply-To: <20181018131125.6303-1-mszeredi@redhat.com>
On Thu, Oct 18, 2018 at 03:11:23PM +0200, Miklos Szeredi wrote:
> Orangefs only handles STATX_BASIC_STATS in its getattr implementation, so
> mask off all other flags. Not doing so results in statx(2) forcing a
> refresh of cached attributes on any other requested flag (i.e. STATX_BTIME
> currently) due to the following test in orangefs_inode_getattr():
>
> (request_mask & orangefs_inode->getattr_mask) == request_mask
>
> Also clean up gratuitous uses of STATX_ALL.
>
> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
> Cc: Mike Marshall <hubcap@omnibond.com>
> Cc: Martin Brandenburg <martin@omnibond.com>
Reviewed-by: Martin Brandenburg <martin@omnibond.com>
> ---
> fs/orangefs/inode.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c
> index 31932879b716..bd7f15a831dc 100644
> --- a/fs/orangefs/inode.c
> +++ b/fs/orangefs/inode.c
> @@ -256,7 +256,8 @@ int orangefs_getattr(const struct path *path, struct kstat *stat,
> "orangefs_getattr: called on %pd\n",
> path->dentry);
>
> - ret = orangefs_inode_getattr(inode, 0, 0, request_mask);
> + ret = orangefs_inode_getattr(inode, 0, 0,
> + request_mask & STATX_BASIC_STATS);
> if (ret == 0) {
> generic_fillattr(inode, stat);
>
> @@ -408,7 +409,7 @@ struct inode *orangefs_iget(struct super_block *sb,
> if (!inode || !(inode->i_state & I_NEW))
> return inode;
>
> - error = orangefs_inode_getattr(inode, 1, 1, STATX_ALL);
> + error = orangefs_inode_getattr(inode, 1, 1, STATX_BASIC_STATS);
> if (error) {
> iget_failed(inode);
> return ERR_PTR(error);
> @@ -453,7 +454,7 @@ struct inode *orangefs_new_inode(struct super_block *sb, struct inode *dir,
> orangefs_set_inode(inode, ref);
> inode->i_ino = hash; /* needed for stat etc */
>
> - error = orangefs_inode_getattr(inode, 1, 1, STATX_ALL);
> + error = orangefs_inode_getattr(inode, 1, 1, STATX_BASIC_STATS);
> if (error)
> goto out_iput;
>
> --
> 2.14.3
>
prev parent reply other threads:[~2018-10-18 21:45 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-18 13:11 [PATCH 1/3] orangefs: fix request_mask misuse Miklos Szeredi
2018-10-18 13:11 ` [PATCH 2/3] uapi: get rid of STATX_ALL Miklos Szeredi
2018-10-18 13:15 ` Florian Weimer
2018-10-18 14:32 ` Miklos Szeredi
2018-10-18 14:34 ` Miklos Szeredi
2018-10-19 1:45 ` Andreas Dilger
2018-10-18 14:51 ` Amir Goldstein
2018-10-18 16:11 ` Florian Weimer
2018-10-19 2:25 ` Andreas Dilger
2018-10-18 13:11 ` [PATCH 3/3] statx: add STATX_ATTRIBUTES flag Miklos Szeredi
2018-10-19 1:48 ` Andreas Dilger
2018-10-18 15:16 ` [PATCH 2/3] uapi: get rid of STATX_ALL David Howells
2018-10-18 15:22 ` [PATCH 3/3] statx: add STATX_ATTRIBUTES flag David Howells
2018-10-18 21:45 ` martin [this message]
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=20181018214517.GA44581@t480s.mkb.name \
--to=martin@omnibond.com \
--cc=adilger@dilger.ca \
--cc=amir73il@gmail.com \
--cc=dhowells@redhat.com \
--cc=fw@deneb.enyo.de \
--cc=hubcap@omnibond.com \
--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).