提交 c55703d8 编写于 作者: E Eric Van Hensbergen

9p: fix bug in attach-per-user

When a new user attached at a directory other than the root, he would end
up in the parent directory of the cwd.  This was due to a logic error in
the code which attaches the user at the mount point and walks back to the
cwd.  This patch fixes that.
Signed-off-by: NEric Van Hensbergen <ericvh@gmail.com>
上级 e2735b77
......@@ -175,7 +175,7 @@ struct p9_fid *v9fs_fid_lookup(struct dentry *dentry)
if (!wnames)
return ERR_PTR(-ENOMEM);
for (d = dentry, i = n; i >= 0; i--, d = d->d_parent)
for (d = dentry, i = (n-1); i >= 0; i--, d = d->d_parent)
wnames[i] = (char *) d->d_name.name;
clone = 1;
......@@ -183,7 +183,7 @@ struct p9_fid *v9fs_fid_lookup(struct dentry *dentry)
while (i < n) {
l = min(n - i, P9_MAXWELEM);
fid = p9_client_walk(fid, l, &wnames[i], clone);
if (!fid) {
if (IS_ERR(fid)) {
kfree(wnames);
return fid;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册