aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Van Hensbergen <ericvh@opteron.homeip.net>2008-02-06 20:25:08 -0500
committerEric Van Hensbergen <ericvh@opteron.homeip.net>2008-02-06 20:25:08 -0500
commitc55703d807a8c6c239a5fea7b9cd7da08c27d7a9 (patch)
treed0dc2da7b6ef0600eb3a626eee1f4717da20763f
parente2735b7720320b68590ca2b32b78ca91213931b2 (diff)
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: Eric Van Hensbergen <ericvh@gmail.com>
-rw-r--r--fs/9p/fid.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/9p/fid.c b/fs/9p/fid.c
index b364da70ff28..dfebdbe7440e 100644
--- a/fs/9p/fid.c
+++ b/fs/9p/fid.c
@@ -175,7 +175,7 @@ struct p9_fid *v9fs_fid_lookup(struct dentry *dentry)
175 if (!wnames) 175 if (!wnames)
176 return ERR_PTR(-ENOMEM); 176 return ERR_PTR(-ENOMEM);
177 177
178 for (d = dentry, i = n; i >= 0; i--, d = d->d_parent) 178 for (d = dentry, i = (n-1); i >= 0; i--, d = d->d_parent)
179 wnames[i] = (char *) d->d_name.name; 179 wnames[i] = (char *) d->d_name.name;
180 180
181 clone = 1; 181 clone = 1;
@@ -183,7 +183,7 @@ struct p9_fid *v9fs_fid_lookup(struct dentry *dentry)
183 while (i < n) { 183 while (i < n) {
184 l = min(n - i, P9_MAXWELEM); 184 l = min(n - i, P9_MAXWELEM);
185 fid = p9_client_walk(fid, l, &wnames[i], clone); 185 fid = p9_client_walk(fid, l, &wnames[i], clone);
186 if (!fid) { 186 if (IS_ERR(fid)) {
187 kfree(wnames); 187 kfree(wnames);
188 return fid; 188 return fid;
189 } 189 }