Skip to content

Commit

Permalink
9p: fix bug in attach-per-user
Browse files Browse the repository at this point in the history
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: Eric Van Hensbergen <[email protected]>
  • Loading branch information
Eric Van Hensbergen committed Feb 7, 2008
1 parent e2735b7 commit c55703d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/9p/fid.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,15 @@ 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;
i = 0;
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;
}
Expand Down

0 comments on commit c55703d

Please sign in to comment.