Commit e70c4908 authored by Trond Myklebust's avatar Trond Myklebust

NFS: Remove redundant check in nfs_check_verifier()

The check for nfs_attribute_timeout(dir) in nfs_check_verifier is
redundant: nfs_lookup_revalidate() will already call nfs_revalidate_inode()
on the parent dir when necessary.

The only case where this is not done is the case of a negative dentry. Fix
this case by moving up the revalidation code.
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent e62c2bba
...@@ -655,9 +655,7 @@ static int nfs_check_verifier(struct inode *dir, struct dentry *dentry) ...@@ -655,9 +655,7 @@ static int nfs_check_verifier(struct inode *dir, struct dentry *dentry)
if (IS_ROOT(dentry)) if (IS_ROOT(dentry))
return 1; return 1;
verf = (unsigned long)dentry->d_fsdata; verf = (unsigned long)dentry->d_fsdata;
if ((NFS_I(dir)->cache_validity & NFS_INO_INVALID_ATTR) != 0 if (nfs_caches_unstable(dir)
|| nfs_attribute_timeout(dir)
|| nfs_caches_unstable(dir)
|| verf != NFS_I(dir)->cache_change_attribute) || verf != NFS_I(dir)->cache_change_attribute)
return 0; return 0;
return 1; return 1;
...@@ -769,6 +767,10 @@ static int nfs_lookup_revalidate(struct dentry * dentry, struct nameidata *nd) ...@@ -769,6 +767,10 @@ static int nfs_lookup_revalidate(struct dentry * dentry, struct nameidata *nd)
nfs_inc_stats(dir, NFSIOS_DENTRYREVALIDATE); nfs_inc_stats(dir, NFSIOS_DENTRYREVALIDATE);
inode = dentry->d_inode; inode = dentry->d_inode;
/* Revalidate parent directory attribute cache */
if (nfs_revalidate_inode(NFS_SERVER(dir), dir) < 0)
goto out_zap_parent;
if (!inode) { if (!inode) {
if (nfs_neg_need_reval(dir, dentry, nd)) if (nfs_neg_need_reval(dir, dentry, nd))
goto out_bad; goto out_bad;
...@@ -782,10 +784,6 @@ static int nfs_lookup_revalidate(struct dentry * dentry, struct nameidata *nd) ...@@ -782,10 +784,6 @@ static int nfs_lookup_revalidate(struct dentry * dentry, struct nameidata *nd)
goto out_bad; goto out_bad;
} }
/* Revalidate parent directory attribute cache */
if (nfs_revalidate_inode(NFS_SERVER(dir), dir) < 0)
goto out_zap_parent;
/* Force a full look up iff the parent directory has changed */ /* Force a full look up iff the parent directory has changed */
if (nfs_check_verifier(dir, dentry)) { if (nfs_check_verifier(dir, dentry)) {
if (nfs_lookup_verify_inode(inode, nd)) if (nfs_lookup_verify_inode(inode, nd))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment