NFS: Fix up handling of outstanding layoutcommit in nfs_update_inode()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Thu, 25 Mar 2021 18:51:36 +0000 (14:51 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Tue, 13 Apr 2021 14:03:03 +0000 (10:03 -0400)
If there is an outstanding layoutcommit, then the list of attributes
whose values are expected to change is not the full set. So let's
be explicit about the full list.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/inode.c

index 81e3e14..18c7277 100644 (file)
@@ -1933,7 +1933,11 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
        nfs_wcc_update_inode(inode, fattr);
 
        if (pnfs_layoutcommit_outstanding(inode)) {
-               nfsi->cache_validity |= save_cache_validity & NFS_INO_INVALID_ATTR;
+               nfsi->cache_validity |=
+                       save_cache_validity &
+                       (NFS_INO_INVALID_CHANGE | NFS_INO_INVALID_CTIME |
+                        NFS_INO_INVALID_MTIME | NFS_INO_INVALID_SIZE |
+                        NFS_INO_REVAL_FORCED);
                cache_revalidated = false;
        }