diff options
Diffstat (limited to 'fs/9p/vfs_inode.c')
-rw-r--r-- | fs/9p/vfs_inode.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index 466002a1fe32..f11edde6432e 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c | |||
@@ -385,13 +385,14 @@ v9fs_create(struct inode *dir, | |||
385 | fid->iounit = iounit; | 385 | fid->iounit = iounit; |
386 | } else { | 386 | } else { |
387 | err = v9fs_t_clunk(v9ses, newfid); | 387 | err = v9fs_t_clunk(v9ses, newfid); |
388 | newfid = -1; | ||
388 | if (err < 0) | 389 | if (err < 0) |
389 | dprintk(DEBUG_ERROR, "clunk for mkdir failed: %d\n", err); | 390 | dprintk(DEBUG_ERROR, "clunk for mkdir failed: %d\n", err); |
390 | } | 391 | } |
391 | 392 | ||
392 | /* walk to the newly created file and put the fid in the dentry */ | 393 | /* walk to the newly created file and put the fid in the dentry */ |
393 | wfidno = v9fs_get_idpool(&v9ses->fidpool); | 394 | wfidno = v9fs_get_idpool(&v9ses->fidpool); |
394 | if (newfid < 0) { | 395 | if (wfidno < 0) { |
395 | eprintk(KERN_WARNING, "no free fids available\n"); | 396 | eprintk(KERN_WARNING, "no free fids available\n"); |
396 | return -ENOSPC; | 397 | return -ENOSPC; |
397 | } | 398 | } |
@@ -408,7 +409,6 @@ v9fs_create(struct inode *dir, | |||
408 | fcall = NULL; | 409 | fcall = NULL; |
409 | 410 | ||
410 | if (!v9fs_fid_create(file_dentry, v9ses, wfidno, 0)) { | 411 | if (!v9fs_fid_create(file_dentry, v9ses, wfidno, 0)) { |
411 | v9fs_t_clunk(v9ses, newfid); | ||
412 | v9fs_put_idpool(wfidno, &v9ses->fidpool); | 412 | v9fs_put_idpool(wfidno, &v9ses->fidpool); |
413 | 413 | ||
414 | goto CleanUpFid; | 414 | goto CleanUpFid; |
@@ -419,7 +419,7 @@ v9fs_create(struct inode *dir, | |||
419 | (perm & V9FS_DMDEVICE)) | 419 | (perm & V9FS_DMDEVICE)) |
420 | return 0; | 420 | return 0; |
421 | 421 | ||
422 | result = v9fs_t_stat(v9ses, newfid, &fcall); | 422 | result = v9fs_t_stat(v9ses, wfidno, &fcall); |
423 | if (result < 0) { | 423 | if (result < 0) { |
424 | dprintk(DEBUG_ERROR, "stat error: %s(%d)\n", FCALL_ERROR(fcall), | 424 | dprintk(DEBUG_ERROR, "stat error: %s(%d)\n", FCALL_ERROR(fcall), |
425 | result); | 425 | result); |