aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/vfs.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2009-04-18 02:42:05 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2009-06-11 21:36:00 -0400
commit91c9fa8f75877c0c1e455c23e8f8206c91c8f77f (patch)
treeee26e614577b079102327393832b2ed503a4b527 /fs/nfsd/vfs.c
parent5bf3bd2b5cb68ba43c91f5bd0ac043543fba2558 (diff)
switch rqst_exp_get_by_name()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/nfsd/vfs.c')
-rw-r--r--fs/nfsd/vfs.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index bd584bcf1d9f..d84c4eaa526b 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -101,36 +101,36 @@ nfsd_cross_mnt(struct svc_rqst *rqstp, struct dentry **dpp,
101{ 101{
102 struct svc_export *exp = *expp, *exp2 = NULL; 102 struct svc_export *exp = *expp, *exp2 = NULL;
103 struct dentry *dentry = *dpp; 103 struct dentry *dentry = *dpp;
104 struct vfsmount *mnt = mntget(exp->ex_path.mnt); 104 struct path path = {.mnt = mntget(exp->ex_path.mnt),
105 struct dentry *mounts = dget(dentry); 105 .dentry = dget(dentry)};
106 int err = 0; 106 int err = 0;
107 107
108 while (follow_down(&mnt,&mounts)&&d_mountpoint(mounts)); 108 while (follow_down(&path.mnt, &path.dentry) &&
109 d_mountpoint(path.dentry))
110 ;
109 111
110 exp2 = rqst_exp_get_by_name(rqstp, mnt, mounts); 112 exp2 = rqst_exp_get_by_name(rqstp, &path);
111 if (IS_ERR(exp2)) { 113 if (IS_ERR(exp2)) {
112 if (PTR_ERR(exp2) != -ENOENT) 114 if (PTR_ERR(exp2) != -ENOENT)
113 err = PTR_ERR(exp2); 115 err = PTR_ERR(exp2);
114 dput(mounts); 116 path_put(&path);
115 mntput(mnt);
116 goto out; 117 goto out;
117 } 118 }
118 if ((exp->ex_flags & NFSEXP_CROSSMOUNT) || EX_NOHIDE(exp2)) { 119 if ((exp->ex_flags & NFSEXP_CROSSMOUNT) || EX_NOHIDE(exp2)) {
119 /* successfully crossed mount point */ 120 /* successfully crossed mount point */
120 /* 121 /*
121 * This is subtle: dentry is *not* under mnt at this point. 122 * This is subtle: path.dentry is *not* on path.mnt
122 * The only reason we are safe is that original mnt is pinned 123 * at this point. The only reason we are safe is that
123 * down by exp, so we should dput before putting exp. 124 * original mnt is pinned down by exp, so we should
125 * put path *before* putting exp
124 */ 126 */
125 dput(dentry); 127 *dpp = path.dentry;
126 *dpp = mounts; 128 path.dentry = dentry;
127 exp_put(exp);
128 *expp = exp2; 129 *expp = exp2;
129 } else { 130 exp2 = exp;
130 exp_put(exp2);
131 dput(mounts);
132 } 131 }
133 mntput(mnt); 132 path_put(&path);
133 exp_put(exp2);
134out: 134out:
135 return err; 135 return err;
136} 136}