Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147817
b: refs/heads/master
c: e64c390
h: refs/heads/master
i:
  147815: d52c94b
v: v3
  • Loading branch information
Al Viro committed Jun 12, 2009
1 parent cf7c809 commit 9b96fca
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 29 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 91c9fa8f75877c0c1e455c23e8f8206c91c8f77f
refs/heads/master: e64c390ca0b60fd2119331ef1fa888d7ea27e424
25 changes: 10 additions & 15 deletions trunk/fs/nfsd/export.c
Original file line number Diff line number Diff line change
Expand Up @@ -1299,24 +1299,19 @@ rqst_exp_find(struct svc_rqst *rqstp, int fsid_type, u32 *fsidv)
}

struct svc_export *
rqst_exp_parent(struct svc_rqst *rqstp, struct vfsmount *mnt,
struct dentry *dentry)
rqst_exp_parent(struct svc_rqst *rqstp, struct path *path)
{
struct svc_export *exp;
struct path path = {.mnt = mnt, .dentry = dentry};

dget(dentry);
exp = rqst_exp_get_by_name(rqstp, &path);

while (PTR_ERR(exp) == -ENOENT && !IS_ROOT(dentry)) {
struct dentry *parent;
struct dentry *saved = dget(path->dentry);
struct svc_export *exp = rqst_exp_get_by_name(rqstp, path);

parent = dget_parent(dentry);
dput(dentry);
dentry = parent;
exp = rqst_exp_get_by_name(rqstp, &path);
while (PTR_ERR(exp) == -ENOENT && !IS_ROOT(path->dentry)) {
struct dentry *parent = dget_parent(path->dentry);
dput(path->dentry);
path->dentry = parent;
exp = rqst_exp_get_by_name(rqstp, path);
}
dput(dentry);
dput(path->dentry);
path->dentry = saved;
return exp;
}

Expand Down
23 changes: 12 additions & 11 deletions trunk/fs/nfsd/vfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,28 +169,29 @@ nfsd_lookup_dentry(struct svc_rqst *rqstp, struct svc_fh *fhp,
/* checking mountpoint crossing is very different when stepping up */
struct svc_export *exp2 = NULL;
struct dentry *dp;
struct vfsmount *mnt = mntget(exp->ex_path.mnt);
dentry = dget(dparent);
while(dentry == mnt->mnt_root && follow_up(&mnt, &dentry))
struct path path = {.mnt = mntget(exp->ex_path.mnt),
.dentry = dget(dparent)};

while (path.dentry == path.mnt->mnt_root &&
follow_up(&path.mnt, &path.dentry))
;
dp = dget_parent(dentry);
dput(dentry);
dentry = dp;
dp = dget_parent(path.dentry);
dput(path.dentry);
path.dentry = dp;

exp2 = rqst_exp_parent(rqstp, mnt, dentry);
exp2 = rqst_exp_parent(rqstp, &path);
if (PTR_ERR(exp2) == -ENOENT) {
dput(dentry);
dentry = dget(dparent);
} else if (IS_ERR(exp2)) {
host_err = PTR_ERR(exp2);
dput(dentry);
mntput(mnt);
path_put(&path);
goto out_nfserr;
} else {
dentry = dget(path.dentry);
exp_put(exp);
exp = exp2;
}
mntput(mnt);
path_put(&path);
}
} else {
fh_lock(fhp);
Expand Down
3 changes: 1 addition & 2 deletions trunk/include/linux/nfsd/export.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ void exp_readunlock(void);
struct svc_export * rqst_exp_get_by_name(struct svc_rqst *,
struct path *);
struct svc_export * rqst_exp_parent(struct svc_rqst *,
struct vfsmount *mnt,
struct dentry *dentry);
struct path *);
int exp_rootfh(struct auth_domain *,
char *path, struct knfsd_fh *, int maxsize);
__be32 exp_pseudoroot(struct svc_rqst *, struct svc_fh *);
Expand Down

0 comments on commit 9b96fca

Please sign in to comment.