diff mbox series

[03/17] NFS: Mask out unsupported attributes in nfs_getattr()

Message ID 20210330001835.41914-4-trondmy@kernel.org (mailing list archive)
State New
Headers show
Series Attribute revalidation updates | expand

Commit Message

trondmy@kernel.org March 30, 2021, 12:18 a.m. UTC
From: Trond Myklebust <trond.myklebust@hammerspace.com>

We don't currently support STATX_BTIME, so don't advertise it in the
return values for nfs_getattr().

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
---
 fs/nfs/inode.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 8de5b3b9da91..93f487c15663 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -815,6 +815,10 @@  int nfs_getattr(struct user_namespace *mnt_userns, const struct path *path,
 
 	trace_nfs_getattr_enter(inode);
 
+	request_mask &= ~(STATX_TYPE | STATX_MODE | STATX_NLINK | STATX_UID |
+			  STATX_GID | STATX_ATIME | STATX_MTIME | STATX_CTIME |
+			  STATX_INO | STATX_SIZE | STATX_BLOCKS);
+
 	if ((query_flags & AT_STATX_DONT_SYNC) && !force_sync) {
 		nfs_readdirplus_parent_cache_hit(path->dentry);
 		goto out_no_update;