提交 cf8ba45e 编写于 作者: T Trond Myklebust

NFS: don't cache the verifer across ->lookup() calls

If the ->lookup() call causes the directory verifier to change, then there
is still no need to use the old verifier, since our dentry has been
verified.
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 f3821110
...@@ -735,7 +735,6 @@ static int nfs_lookup_revalidate(struct dentry * dentry, struct nameidata *nd) ...@@ -735,7 +735,6 @@ static int nfs_lookup_revalidate(struct dentry * dentry, struct nameidata *nd)
int error; int error;
struct nfs_fh fhandle; struct nfs_fh fhandle;
struct nfs_fattr fattr; struct nfs_fattr fattr;
unsigned long verifier;
parent = dget_parent(dentry); parent = dget_parent(dentry);
lock_kernel(); lock_kernel();
...@@ -770,7 +769,6 @@ static int nfs_lookup_revalidate(struct dentry * dentry, struct nameidata *nd) ...@@ -770,7 +769,6 @@ static int nfs_lookup_revalidate(struct dentry * dentry, struct nameidata *nd)
if (NFS_STALE(inode)) if (NFS_STALE(inode))
goto out_bad; goto out_bad;
verifier = nfs_save_change_attribute(dir);
error = NFS_PROTO(dir)->lookup(dir, &dentry->d_name, &fhandle, &fattr); error = NFS_PROTO(dir)->lookup(dir, &dentry->d_name, &fhandle, &fattr);
if (error) if (error)
goto out_bad; goto out_bad;
...@@ -779,7 +777,7 @@ static int nfs_lookup_revalidate(struct dentry * dentry, struct nameidata *nd) ...@@ -779,7 +777,7 @@ static int nfs_lookup_revalidate(struct dentry * dentry, struct nameidata *nd)
if ((error = nfs_refresh_inode(inode, &fattr)) != 0) if ((error = nfs_refresh_inode(inode, &fattr)) != 0)
goto out_bad; goto out_bad;
nfs_set_verifier(dentry, verifier); nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
out_valid: out_valid:
unlock_kernel(); unlock_kernel();
dput(parent); dput(parent);
...@@ -1048,7 +1046,6 @@ static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd) ...@@ -1048,7 +1046,6 @@ static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd)
struct dentry *parent = NULL; struct dentry *parent = NULL;
struct inode *inode = dentry->d_inode; struct inode *inode = dentry->d_inode;
struct inode *dir; struct inode *dir;
unsigned long verifier;
int openflags, ret = 0; int openflags, ret = 0;
parent = dget_parent(dentry); parent = dget_parent(dentry);
...@@ -1076,10 +1073,9 @@ static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd) ...@@ -1076,10 +1073,9 @@ static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd)
* change attribute *before* we do the RPC call. * change attribute *before* we do the RPC call.
*/ */
lock_kernel(); lock_kernel();
verifier = nfs_save_change_attribute(dir);
ret = nfs4_open_revalidate(dir, dentry, openflags, nd); ret = nfs4_open_revalidate(dir, dentry, openflags, nd);
if (ret == 1) if (ret == 1)
nfs_set_verifier(dentry, verifier); nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
unlock_kernel(); unlock_kernel();
out: out:
dput(parent); dput(parent);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册