aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLatchesar Ionkov <lucho@ionkov.net>2006-01-08 01:04:59 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-08 20:14:05 -0800
commitd8da097afb765654c866062148fd98b11db9003e (patch)
tree35dc36ed893bceb63168eba245791b6d0a850698
parent3cf6429a26da5c4d7b795e6d0f8f56ed2e4fdfc0 (diff)
[PATCH] v9fs: fix fid management in v9fs_create
v9fs_create doesn't manage correctly the fids when it is called to create a directory.. The fid created by the create 9P call (newfid) and the one created by walking to already created file (wfidno) are not used consistently. This patch cleans up the usage of newfid and wfidno. Signed-off-by: Latchesar Ionkov <lucho@ionkov.net> Cc: Eric Van Hensbergen <ericvh@ericvh.myip.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--fs/9p/vfs_inode.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index 466002a1fe3..f11edde6432 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -385,13 +385,14 @@ v9fs_create(struct inode *dir,
fid->iounit = iounit;
} else {
err = v9fs_t_clunk(v9ses, newfid);
+ newfid = -1;
if (err < 0)
dprintk(DEBUG_ERROR, "clunk for mkdir failed: %d\n", err);
}
/* walk to the newly created file and put the fid in the dentry */
wfidno = v9fs_get_idpool(&v9ses->fidpool);
- if (newfid < 0) {
+ if (wfidno < 0) {
eprintk(KERN_WARNING, "no free fids available\n");
return -ENOSPC;
}
@@ -408,7 +409,6 @@ v9fs_create(struct inode *dir,
fcall = NULL;
if (!v9fs_fid_create(file_dentry, v9ses, wfidno, 0)) {
- v9fs_t_clunk(v9ses, newfid);
v9fs_put_idpool(wfidno, &v9ses->fidpool);
goto CleanUpFid;
@@ -419,7 +419,7 @@ v9fs_create(struct inode *dir,
(perm & V9FS_DMDEVICE))
return 0;
- result = v9fs_t_stat(v9ses, newfid, &fcall);
+ result = v9fs_t_stat(v9ses, wfidno, &fcall);
if (result < 0) {
dprintk(DEBUG_ERROR, "stat error: %s(%d)\n", FCALL_ERROR(fcall),
result);