summaryrefslogtreecommitdiff
path: root/fs/fuse
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2023-08-10 12:45:05 +0200
committerMiklos Szeredi <mszeredi@redhat.com>2023-08-16 12:39:24 +0200
commit8d8f9c4b8df6bc2bf005c91b73b23a0e60f0e413 (patch)
treeb0d5fbb248041576686467d2635fc0b934200856 /fs/fuse
parentb5a2a3a0b77668257fa72ee6bc0eac90493f13c1 (diff)
fuse: handle empty request_mask in statx
If no attribute is requested, then don't send request to userspace. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse')
-rw-r--r--fs/fuse/dir.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index f67bef9d83c4..d38ab93e2007 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -1209,7 +1209,12 @@ static int fuse_update_get_attr(struct inode *inode, struct file *file,
u32 inval_mask = READ_ONCE(fi->inval_mask);
u32 cache_mask = fuse_get_cache_mask(inode);
- if (flags & AT_STATX_FORCE_SYNC)
+ /* FUSE only supports basic stats */
+ request_mask &= STATX_BASIC_STATS;
+
+ if (!request_mask)
+ sync = false;
+ else if (flags & AT_STATX_FORCE_SYNC)
sync = true;
else if (flags & AT_STATX_DONT_SYNC)
sync = false;