NFS: Fix up nfs_readdir_inode_mapping_valid()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Tue, 28 Sep 2021 16:37:05 +0000 (12:37 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 4 Oct 2021 00:49:07 +0000 (20:49 -0400)
The check for duplicate readdir cookies should only care if the change
attribute is invalid or the data cache is invalid.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Tested-by: Benjamin Coddington <bcodding@redhat.com>
Reviewed-by: Benjamin Coddington <bcodding@redhat.com>
fs/nfs/dir.c

index f2df664..fa4d336 100644 (file)
@@ -411,7 +411,8 @@ out_eof:
 static bool
 nfs_readdir_inode_mapping_valid(struct nfs_inode *nfsi)
 {
-       if (nfsi->cache_validity & (NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA))
+       if (nfsi->cache_validity & (NFS_INO_INVALID_CHANGE |
+                                   NFS_INO_INVALID_DATA))
                return false;
        smp_rmb();
        return !test_bit(NFS_INO_INVALIDATING, &nfsi->flags);