5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust trond.myklebust@hammerspace.com
This reverts commit 36a9346c225270262d9f34e66c91aa1723fa903f.
The above commit was incorrectly labelled as a dependency for commit b01f21cacde9 ("NFS: Fix the setting of capabilities when automounting a new filesystem") A revert is needed, since the incorrectly applied commit depends upon a series of other patches that were merged into Linux 5.13, but have not been applied to the 5.10 stable series.
Reported-by: "Ahmed, Aaron" aarnahmd@amazon.com Signed-off-by: Trond Myklebust trond.myklebust@hammerspace.com Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org --- fs/nfs/inode.c | 6 ++++-- fs/nfs/nfs4proc.c | 1 + 2 files changed, 5 insertions(+), 2 deletions(-)
--- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -217,12 +217,11 @@ static void nfs_set_cache_invalid(struct flags &= ~NFS_INO_INVALID_OTHER; flags &= ~(NFS_INO_INVALID_CHANGE | NFS_INO_INVALID_SIZE + | NFS_INO_REVAL_PAGECACHE | NFS_INO_INVALID_XATTR); } else if (flags & NFS_INO_REVAL_PAGECACHE) flags |= NFS_INO_INVALID_CHANGE | NFS_INO_INVALID_SIZE;
- flags &= ~NFS_INO_REVAL_PAGECACHE; - if (!nfs_has_xattr_cache(nfsi)) flags &= ~NFS_INO_INVALID_XATTR; if (inode->i_mapping->nrpages == 0) @@ -1901,6 +1900,7 @@ static int nfs_update_inode(struct inode nfsi->cache_validity &= ~(NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ATIME | NFS_INO_REVAL_FORCED + | NFS_INO_REVAL_PAGECACHE | NFS_INO_INVALID_BLOCKS);
/* Do atomic weak cache consistency updates */ @@ -1942,6 +1942,7 @@ static int nfs_update_inode(struct inode } else { nfsi->cache_validity |= save_cache_validity & (NFS_INO_INVALID_CHANGE + | NFS_INO_REVAL_PAGECACHE | NFS_INO_REVAL_FORCED); cache_revalidated = false; } @@ -1987,6 +1988,7 @@ static int nfs_update_inode(struct inode } else { nfsi->cache_validity |= save_cache_validity & (NFS_INO_INVALID_SIZE + | NFS_INO_REVAL_PAGECACHE | NFS_INO_REVAL_FORCED); cache_revalidated = false; } --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -1212,6 +1212,7 @@ nfs4_update_changeattr_locked(struct ino | cache_validity;
if (cinfo->atomic && cinfo->before == inode_peek_iversion_raw(inode)) { + nfsi->cache_validity &= ~NFS_INO_REVAL_PAGECACHE; nfsi->attrtimeo_timestamp = jiffies; } else { if (S_ISDIR(inode->i_mode)) {