From: Trond Myklebust Date: Tue, 20 Mar 2018 20:53:32 +0000 (-0400) Subject: NFSv4: Ignore change attribute invalidations if we hold a delegation X-Git-Tag: v4.19~1051^2~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d943f2dd8dba1ecde2de053500a6533e39577bfc;p=platform%2Fkernel%2Flinux-rpi.git NFSv4: Ignore change attribute invalidations if we hold a delegation Don't bother even recording an invalid change attribute if we hold a delegation since we already know the state of our attribute cache. We can rely on the fact that we will pick up a copy from the server when we return the delegation. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker --- diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 23880f4..a2c5d4a 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -200,7 +200,10 @@ bool nfs_check_cache_invalid(struct inode *inode, unsigned long flags) static void nfs_set_cache_invalid(struct inode *inode, unsigned long flags) { struct nfs_inode *nfsi = NFS_I(inode); + bool have_delegation = nfs_have_delegated_attributes(inode); + if (have_delegation) + flags &= ~(NFS_INO_INVALID_CHANGE|NFS_INO_REVAL_PAGECACHE); if (inode->i_mapping->nrpages == 0) flags &= ~NFS_INO_INVALID_DATA; nfsi->cache_validity |= flags;