[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <9D62CF17-A2F8-43A2-A054-AF281FD96C13@dilger.ca>
Date: Fri, 19 Oct 2018 08:27:05 -0600
From: Andreas Dilger <adilger@...ger.ca>
To: Miklos Szeredi <mszeredi@...hat.com>
Cc: Linux FS-devel Mailing List <linux-fsdevel@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-api@...r.kernel.org, David Howells <dhowells@...hat.com>,
Michael Kerrisk <mtk.manpages@...il.com>,
Florian Weimer <fw@...eb.enyo.de>,
Amir Goldstein <amir73il@...il.com>,
Mike Marshall <hubcap@...ibond.com>
Subject: Re: [PATCH v2 1/5] orangefs: fix request_mask misuse
On Oct 19, 2018, at 6:20 AM, Miklos Szeredi <mszeredi@...hat.com> 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@...hat.com>
> Reviewed-by: Martin Brandenburg <martin@...ibond.com>
> Cc: Mike Marshall <hubcap@...ibond.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);
Does it make sense to mask this off at the caller, rather than within
orangefs_inode_getattr()? Otherwise, orangefs_inode_getattr() will
never see additional stats passed in, even if it is enhanced to return
other values.
Cheers, Andreas
Download attachment "signature.asc" of type "application/pgp-signature" (874 bytes)
Powered by blists - more mailing lists