mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-21 01:51:18 +00:00
NFS: Don't set NFS_INO_DATA_INVAL_DEFER and NFS_INO_INVALID_DATA
[ Upstream commit488796ec1e
] NFS_INO_DATA_INVAL_DEFER and NFS_INO_INVALID_DATA should be considered mutually exclusive. Fixes:1c341b7775
("NFS: Add deferred cache invalidation for close-to-open consistency violations") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Tested-by: Benjamin Coddington <bcodding@redhat.com> Reviewed-by: Benjamin Coddington <bcodding@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
7e2801edf2
commit
69e0be0efe
1 changed files with 7 additions and 2 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue