All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] NFS: Don't set NFS_INO_DATA_INVAL_DEFER and NFS_INO_INVALID_DATA
@ 2021-09-29 13:49 trondmy
  2021-09-29 13:49 ` [PATCH 2/5] NFS: Ignore the directory size when marking for revalidation trondmy
  0 siblings, 1 reply; 11+ messages in thread
From: trondmy @ 2021-09-29 13:49 UTC (permalink / raw)
  To: linux-nfs

From: Trond Myklebust <trond.myklebust@hammerspace.com>

NFS_INO_DATA_INVAL_DEFER and NFS_INO_INVALID_DATA should be considered
mutually exclusive.

Fixes: 1c341b777501 ("NFS: Add deferred cache invalidation for close-to-open consistency violations")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
---
 fs/nfs/inode.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 0f092ccb0ca1..dcb885b7ad73 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -210,10 +210,15 @@ void nfs_set_cache_invalid(struct inode *inode, unsigned long flags)
 		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);
 	flags &= ~(NFS_INO_REVAL_PAGECACHE | NFS_INO_REVAL_FORCED);
+
 	nfsi->cache_validity |= flags;
+
+	if (inode->i_mapping->nrpages == 0)
+		nfsi->cache_validity &= ~(NFS_INO_INVALID_DATA |
+					  NFS_INO_DATA_INVAL_DEFER);
+	else if (nfsi->cache_validity & NFS_INO_INVALID_DATA)
+		nfsi->cache_validity &= ~NFS_INO_DATA_INVAL_DEFER;
 }
 EXPORT_SYMBOL_GPL(nfs_set_cache_invalid);
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-09-30 14:51 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-29 13:49 [PATCH 1/5] NFS: Don't set NFS_INO_DATA_INVAL_DEFER and NFS_INO_INVALID_DATA trondmy
2021-09-29 13:49 ` [PATCH 2/5] NFS: Ignore the directory size when marking for revalidation trondmy
2021-09-29 13:49   ` [PATCH 3/5] NFS: Fix up nfs_readdir_inode_mapping_valid() trondmy
2021-09-29 13:49     ` [PATCH 4/5] NFS: Further optimisations for 'ls -l' trondmy
2021-09-29 13:49       ` [PATCH 5/5] NFS: Fix dentry verifier races trondmy
2021-09-29 14:56       ` [PATCH 4/5] NFS: Further optimisations for 'ls -l' Benjamin Coddington
2021-09-29 16:23         ` Trond Myklebust
2021-09-29 20:21           ` Benjamin Coddington
2021-09-29 20:35             ` Trond Myklebust
2021-09-30 14:29               ` Benjamin Coddington
2021-09-30 14:51                 ` Trond Myklebust

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.