aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/inode.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2021-03-26 16:23:39 -0400
committerTrond Myklebust <trond.myklebust@hammerspace.com>2021-04-05 09:04:21 -0400
commitbeab450d8ea93cdf4c6cb7714bdc31a9e0f34738 (patch)
tree40bf98c431cb7fb777a81505471b5c03e53150bf /fs/nfs/inode.c
parentNFS: fix nfs_fetch_iversion() (diff)
downloadlinux-dev-beab450d8ea93cdf4c6cb7714bdc31a9e0f34738.tar.xz
linux-dev-beab450d8ea93cdf4c6cb7714bdc31a9e0f34738.zip
NFS: Fix fscache invalidation in nfs_set_cache_invalid()
Ensure that we invalidate the fscache before we strip the NFS_INO_INVALID_DATA flag. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to '')
-rw-r--r--fs/nfs/inode.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index a7fb076a5f44..ff737be559dc 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -223,11 +223,11 @@ void nfs_set_cache_invalid(struct inode *inode, unsigned long flags)
if (!nfs_has_xattr_cache(nfsi))
flags &= ~NFS_INO_INVALID_XATTR;
+ if (flags & NFS_INO_INVALID_DATA)
+ nfs_fscache_invalidate(inode);
if (inode->i_mapping->nrpages == 0)
flags &= ~(NFS_INO_INVALID_DATA|NFS_INO_DATA_INVAL_DEFER);
nfsi->cache_validity |= flags;
- if (flags & NFS_INO_INVALID_DATA)
- nfs_fscache_invalidate(inode);
}
EXPORT_SYMBOL_GPL(nfs_set_cache_invalid);