summaryrefslogtreecommitdiff
path: root/fs/nfs/dir.c
diff options
context:
space:
mode:
authorTrond Myklebust <trondmy@gmail.com>2020-01-06 15:39:36 -0500
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2020-01-15 10:54:33 -0500
commit5c965db86e6b0e90a3112228820598e824920278 (patch)
tree355a2e4d690621190144bcdb1624a702a5f66d08 /fs/nfs/dir.c
parent4daaeba938228f7c97e80817ccda1e091c7d3fb6 (diff)
NFS: Trust cached access if we've already revalidated the inode once
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>
Diffstat (limited to 'fs/nfs/dir.c')
-rw-r--r--fs/nfs/dir.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 372c16b3042c..9405eeadc3f3 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -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)