aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-10-01 13:46:53 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-10-09 17:19:42 -0400
commitcf8ba45e0554f1c8838fcfe43a93114f177af839 (patch)
treee8799c4eac30b4c42c2be7a02e4848aac6113f44 /fs/nfs
parentf38211100d4823be530577dc3452f838861222ec (diff)
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: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/dir.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index d58bfb81354e..7cd2697f2d32 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -735,7 +735,6 @@ static int nfs_lookup_revalidate(struct dentry * dentry, struct nameidata *nd)
735 int error; 735 int error;
736 struct nfs_fh fhandle; 736 struct nfs_fh fhandle;
737 struct nfs_fattr fattr; 737 struct nfs_fattr fattr;
738 unsigned long verifier;
739 738
740 parent = dget_parent(dentry); 739 parent = dget_parent(dentry);
741 lock_kernel(); 740 lock_kernel();
@@ -770,7 +769,6 @@ static int nfs_lookup_revalidate(struct dentry * dentry, struct nameidata *nd)
770 if (NFS_STALE(inode)) 769 if (NFS_STALE(inode))
771 goto out_bad; 770 goto out_bad;
772 771
773 verifier = nfs_save_change_attribute(dir);
774 error = NFS_PROTO(dir)->lookup(dir, &dentry->d_name, &fhandle, &fattr); 772 error = NFS_PROTO(dir)->lookup(dir, &dentry->d_name, &fhandle, &fattr);
775 if (error) 773 if (error)
776 goto out_bad; 774 goto out_bad;
@@ -779,7 +777,7 @@ static int nfs_lookup_revalidate(struct dentry * dentry, struct nameidata *nd)
779 if ((error = nfs_refresh_inode(inode, &fattr)) != 0) 777 if ((error = nfs_refresh_inode(inode, &fattr)) != 0)
780 goto out_bad; 778 goto out_bad;
781 779
782 nfs_set_verifier(dentry, verifier); 780 nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
783 out_valid: 781 out_valid:
784 unlock_kernel(); 782 unlock_kernel();
785 dput(parent); 783 dput(parent);
@@ -1048,7 +1046,6 @@ static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd)
1048 struct dentry *parent = NULL; 1046 struct dentry *parent = NULL;
1049 struct inode *inode = dentry->d_inode; 1047 struct inode *inode = dentry->d_inode;
1050 struct inode *dir; 1048 struct inode *dir;
1051 unsigned long verifier;
1052 int openflags, ret = 0; 1049 int openflags, ret = 0;
1053 1050
1054 parent = dget_parent(dentry); 1051 parent = dget_parent(dentry);
@@ -1076,10 +1073,9 @@ static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd)
1076 * change attribute *before* we do the RPC call. 1073 * change attribute *before* we do the RPC call.
1077 */ 1074 */
1078 lock_kernel(); 1075 lock_kernel();
1079 verifier = nfs_save_change_attribute(dir);
1080 ret = nfs4_open_revalidate(dir, dentry, openflags, nd); 1076 ret = nfs4_open_revalidate(dir, dentry, openflags, nd);
1081 if (ret == 1) 1077 if (ret == 1)
1082 nfs_set_verifier(dentry, verifier); 1078 nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
1083 unlock_kernel(); 1079 unlock_kernel();
1084out: 1080out:
1085 dput(parent); 1081 dput(parent);