Skip to content

Commit

Permalink
fs/9p: destroy fid on failed remove
Browse files Browse the repository at this point in the history
9P spec says:
"It is correct to consider remove to be a clunk with the
side effect of removing the file if permissions allow. "

So even if remove fails we need to destroy the fid.

Without this patch an rmdir on a directory with contents leave
the new cloned directory fid fid attached to fidlist. On umount
we dump the fids on the fidlist

~# rmdir /mnt2/test4/
rmdir: failed to remove `/mnt2/test4/': Directory not empty
~# umount /mnt2/
~# dmesg
[  228.474323] Found fid 3 not clunked

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
  • Loading branch information
kvaneesh authored and ericvh committed Aug 2, 2010
1 parent a534c8d commit 0b1208b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/9p/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1240,9 +1240,8 @@ int p9_client_remove(struct p9_fid *fid)
P9_DPRINTK(P9_DEBUG_9P, "<<< RREMOVE fid %d\n", fid->fid);

p9_free_req(clnt, req);
p9_fid_destroy(fid);

error:
p9_fid_destroy(fid);
return err;
}
EXPORT_SYMBOL(p9_client_remove);
Expand Down

0 comments on commit 0b1208b

Please sign in to comment.