From: Trond Myklebust Date: Fri, 26 Mar 2021 20:23:39 +0000 (-0400) Subject: NFS: Fix fscache invalidation in nfs_set_cache_invalid() X-Git-Tag: v5.15~1163^2~71 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=beab450d8ea93cdf4c6cb7714bdc31a9e0f34738;p=platform%2Fkernel%2Flinux-starfive.git 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 --- diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index a7fb076..ff737be 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);