Skip to contentSkip to conversation

NFS: Fix fscache invalidation in nfs_set_cache_invalid()

PATCH New [email protected] 1 participant 1 message Mar 30, 2021

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 1/1 NFS: Fix fscache invalidation in nfs_set_cache_invalid()

From: Trond Myklebust <[email protected]>

Ensure that we invalidate the fscache before we strip the NFS_INO_INVALID_DATA flag.

---
 fs/nfs/inode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/nfs/inode.c +2 -2
index a7fb076a5f44..ff737be559dc 100644
@@ -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);
 
Signature · 1 line
2.30.2