diff mbox series

[1/2] orangefs: don't reinitialize result_mask in ->getattr

Message ID 20190121152326.9954-2-hch@lst.de (mailing list archive)
State Accepted
Headers show
Series [1/2] orangefs: don't reinitialize result_mask in ->getattr | expand

Commit Message

Christoph Hellwig Jan. 21, 2019, 3:23 p.m. UTC
The caller already initializes it to the basic stats.  Just
clear not supported default bits where needed.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/orangefs/inode.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Mike Marshall Feb. 3, 2019, 2:44 p.m. UTC | #1
It looks good to both Martin and I, and runs fine through xfstests...
you can add Signed-off-by: Mike Marshall <hubcap@omnibond.com>

-Mike "is there a finally-signed-off-by tag?"


On Mon, Jan 21, 2019 at 10:23 AM Christoph Hellwig <hch@lst.de> wrote:
>
> The caller already initializes it to the basic stats.  Just
> clear not supported default bits where needed.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  fs/orangefs/inode.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c
> index f038235c64bd..c3334eca18c7 100644
> --- a/fs/orangefs/inode.c
> +++ b/fs/orangefs/inode.c
> @@ -261,11 +261,8 @@ int orangefs_getattr(const struct path *path, struct kstat *stat,
>                 generic_fillattr(inode, stat);
>
>                 /* override block size reported to stat */
> -               if (request_mask & STATX_SIZE)
> -                       stat->result_mask = STATX_BASIC_STATS;
> -               else
> -                       stat->result_mask = STATX_BASIC_STATS &
> -                           ~STATX_SIZE;
> +               if (!(request_mask & STATX_SIZE))
> +                       stat->result_mask &= ~STATX_SIZE;
>
>                 stat->attributes_mask = STATX_ATTR_IMMUTABLE |
>                     STATX_ATTR_APPEND;
> --
> 2.20.1
>
diff mbox series

Patch

diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c
index f038235c64bd..c3334eca18c7 100644
--- a/fs/orangefs/inode.c
+++ b/fs/orangefs/inode.c
@@ -261,11 +261,8 @@  int orangefs_getattr(const struct path *path, struct kstat *stat,
 		generic_fillattr(inode, stat);
 
 		/* override block size reported to stat */
-		if (request_mask & STATX_SIZE)
-			stat->result_mask = STATX_BASIC_STATS;
-		else
-			stat->result_mask = STATX_BASIC_STATS &
-			    ~STATX_SIZE;
+		if (!(request_mask & STATX_SIZE))
+			stat->result_mask &= ~STATX_SIZE;
 
 		stat->attributes_mask = STATX_ATTR_IMMUTABLE |
 		    STATX_ATTR_APPEND;