[PATCH] 9p: fix fid behavior on failed remove

From: Eric Van Hensbergen
Date: Sat Jul 29 2006 - 19:13:49 EST


Fix fid behavior on failed remove.

Based on a bug report from Russ Ross <russruss@xxxxxxxxx>

According to the spec:

"The remove request asks the file server both to remove the file
represented by fid and to clunk the fid, even if the remove fails."

but the Linux client seems to expect the fid to be valid after a
failed remove attempt. Specifically, I'm getting this behavior when
attempting to remove a non-empty directory.

Signed-off-by: Eric Van Hensbergen <ericvh@xxxxxxxxx>
---
fs/9p/vfs_inode.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index 61ce38d..91a0ea5 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -433,10 +433,10 @@ static int v9fs_remove(struct inode *dir
result = v9fs_t_remove(v9ses, fid, &fcall);
if (result < 0) {
PRINT_FCALL_ERROR("remove fails", fcall);
- } else {
- v9fs_put_idpool(fid, &v9ses->fidpool);
- v9fs_fid_destroy(v9fid);
- }
+ }
+
+ v9fs_put_idpool(fid, &v9ses->fidpool);
+ v9fs_fid_destroy(v9fid);

kfree(fcall);
return result;
--
1.4.2.rc1.g83e1

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/