Commit 834a9b8ca7a01c34570be021f88e18884a29f048

Authored by Eric Van Hensbergen
Committed by Linus Torvalds
1 parent 1f525f16e0

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

Based on a bug report from Russ Ross <russruss@gmail.com>

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@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 1 changed file with 3 additions and 3 deletions Side-by-side Diff

... ... @@ -434,10 +434,10 @@
434 434 result = v9fs_t_remove(v9ses, fid, &fcall);
435 435 if (result < 0) {
436 436 PRINT_FCALL_ERROR("remove fails", fcall);
437   - } else {
438   - v9fs_put_idpool(fid, &v9ses->fidpool);
439   - v9fs_fid_destroy(v9fid);
440 437 }
  438 +
  439 + v9fs_put_idpool(fid, &v9ses->fidpool);
  440 + v9fs_fid_destroy(v9fid);
441 441  
442 442 kfree(fcall);
443 443 return result;