linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@dilger.ca>
To: Miklos Szeredi <mszeredi@redhat.com>
Cc: Linux FS-devel Mailing List <linux-fsdevel@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-api@vger.kernel.org, David Howells <dhowells@redhat.com>,
	Michael Kerrisk <mtk.manpages@gmail.com>,
	Florian Weimer <fw@deneb.enyo.de>,
	Amir Goldstein <amir73il@gmail.com>,
	Mike Marshall <hubcap@omnibond.com>
Subject: Re: [PATCH v2 1/5] orangefs: fix request_mask misuse
Date: Fri, 19 Oct 2018 08:27:05 -0600	[thread overview]
Message-ID: <9D62CF17-A2F8-43A2-A054-AF281FD96C13@dilger.ca> (raw)
In-Reply-To: <20181019122049.27121-1-mszeredi@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1490 bytes --]

On Oct 19, 2018, at 6:20 AM, Miklos Szeredi <mszeredi@redhat.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@redhat.com>
> Reviewed-by: Martin Brandenburg <martin@omnibond.com>
> Cc: Mike Marshall <hubcap@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);

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






[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 873 bytes --]

  parent reply	other threads:[~2018-10-19 14:33 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
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 ` Andreas Dilger [this message]
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=9D62CF17-A2F8-43A2-A054-AF281FD96C13@dilger.ca \
    --to=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).