Commit 9b9f8494 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] knfsd cleanups

logics in nfsd_lookup() cleaned up (see above, only more so ;-/)
parent 20fa6233
...@@ -114,13 +114,12 @@ nfsd_lookup(struct svc_rqst *rqstp, struct svc_fh *fhp, const char *name, ...@@ -114,13 +114,12 @@ nfsd_lookup(struct svc_rqst *rqstp, struct svc_fh *fhp, const char *name,
if (isdotent(name, len)) { if (isdotent(name, len)) {
if (len==1) if (len==1)
dentry = dget(dparent); dentry = dget(dparent);
else { /* must be ".." */ else if (dparent != exp->ex_dentry)
/* checking mountpoint crossing is very different when stepping up */ dentry = dget(dparent->d_parent);
if (dparent == exp->ex_dentry) { else if (!EX_CROSSMNT(exp))
if (!EX_CROSSMNT(exp))
dentry = dget(dparent); /* .. == . just like at / */ dentry = dget(dparent); /* .. == . just like at / */
else else {
{ /* checking mountpoint crossing is very different when stepping up */
struct svc_export *exp2 = NULL; struct svc_export *exp2 = NULL;
struct dentry *dp; struct dentry *dp;
struct vfsmount *mnt = mntget(exp->ex_mnt); struct vfsmount *mnt = mntget(exp->ex_mnt);
...@@ -130,10 +129,9 @@ nfsd_lookup(struct svc_rqst *rqstp, struct svc_fh *fhp, const char *name, ...@@ -130,10 +129,9 @@ nfsd_lookup(struct svc_rqst *rqstp, struct svc_fh *fhp, const char *name,
dp = dget(dentry->d_parent); dp = dget(dentry->d_parent);
dput(dentry); dput(dentry);
dentry = dp; dentry = dp;
for ( ; exp2 == NULL && dp->d_parent != dp; for ( ; !exp2 && dp->d_parent != dp; dp=dp->d_parent)
dp=dp->d_parent)
exp2 = exp_get_by_name(exp->ex_client, mnt, dp); exp2 = exp_get_by_name(exp->ex_client, mnt, dp);
if (exp2==NULL) { if (!exp2) {
dput(dentry); dput(dentry);
dentry = dget(dparent); dentry = dget(dparent);
} else { } else {
...@@ -141,9 +139,6 @@ nfsd_lookup(struct svc_rqst *rqstp, struct svc_fh *fhp, const char *name, ...@@ -141,9 +139,6 @@ nfsd_lookup(struct svc_rqst *rqstp, struct svc_fh *fhp, const char *name,
} }
mntput(mnt); mntput(mnt);
} }
} else
dentry = dget(dparent->d_parent);
}
} else { } else {
fh_lock(fhp); fh_lock(fhp);
dentry = lookup_one_len(name, dparent, len); dentry = lookup_one_len(name, dparent, len);
......
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