OSDN Git Service

NFS: Remove unnecessary XATTR cache invalidation in nfs_fhget()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 23 Feb 2022 20:46:20 +0000 (15:46 -0500)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Fri, 25 Feb 2022 23:50:13 +0000 (18:50 -0500)
We should never expect the 'xattr_cache' to be non-null in that case,
hence nfs_set_cache_invalid() is just going to optimise it away.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/inode.c

index f9fc506..7cecabf 100644 (file)
@@ -561,8 +561,6 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr)
                        inode->i_gid = fattr->gid;
                else if (fattr_supported & NFS_ATTR_FATTR_GROUP)
                        nfs_set_cache_invalid(inode, NFS_INO_INVALID_OTHER);
-               if (nfs_server_capable(inode, NFS_CAP_XATTR))
-                       nfs_set_cache_invalid(inode, NFS_INO_INVALID_XATTR);
                if (fattr->valid & NFS_ATTR_FATTR_BLOCKS_USED)
                        inode->i_blocks = fattr->du.nfs2.blocks;
                else if (fattr_supported & NFS_ATTR_FATTR_BLOCKS_USED &&