Skip to contentSkip to conversation

9p: fix fid behavior on failed remove

PATCH New Eric Van Hensbergen 1 participant 1 message Jul 29, 2006 9P file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 9p: fix fid behavior on failed remove

Quoted 1 line

From 188a447b579a96ef485ee6911f0e6f7d520f896a Mon Sep 17 00:00:00 2001

From: Eric Van Hensbergen <[email protected]>
Date: Sat, 29 Jul 2006 18:13:49 -0500
Subject: [PATCH] 9p: fix fid behavior on failed remove

Fix fid behavior on failed remove.

Based on a bug report from Russ Ross <[email protected]>

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.

---
 fs/9p/vfs_inode.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
fs/9p/vfs_inode.c +4 -4
index 61ce38d..91a0ea5 100644
@@ -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;
Signature · 1 line
1.4.2.rc1.g83e1