NFS: Trust cached access if we've already revalidated the inode once
authorTrond Myklebust <trondmy@gmail.com>
Mon, 6 Jan 2020 20:39:36 +0000 (15:39 -0500)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Wed, 15 Jan 2020 15:54:33 +0000 (10:54 -0500)
If we've already revalidated the inode once then don't distrust the
access cache unless the NFS_INO_INVALID_ACCESS flag is actually set.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/dir.c

index 372c16b3042c38ddf49982acd408203e8e5de587..9405eeadc3f385fe9a3de59f9adcb83b5b739d2d 100644 (file)
@@ -2312,11 +2312,11 @@ static int nfs_access_get_cached(struct inode *inode, const struct cred *cred, s
                /* Found an entry, is our attribute cache valid? */
                if (!nfs_check_cache_invalid(inode, NFS_INO_INVALID_ACCESS))
                        break;
+               if (!retry)
+                       break;
                err = -ECHILD;
                if (!may_block)
                        goto out;
-               if (!retry)
-                       goto out_zap;
                spin_unlock(&inode->i_lock);
                err = __nfs_revalidate_inode(NFS_SERVER(inode), inode);
                if (err)