From 9bdda4ce0aaebb3f8109152f056d9b35229fb708 Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Thu, 13 May 2010 06:59:19 +0000 Subject: nfs3: Final unref only on successful remove The final unref on the inode during a file removal should take place only if the file removal was successful. Signed-off-by: Shehjar Tikoo Signed-off-by: Anand V. Avati BUG: 857 (Crash in afr_sh_entry_expunge_entry_cbk) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=857 --- xlators/nfs/server/src/nfs3.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'xlators/nfs/server') diff --git a/xlators/nfs/server/src/nfs3.c b/xlators/nfs/server/src/nfs3.c index 7a1a0fc3d..b5db1b966 100644 --- a/xlators/nfs/server/src/nfs3.c +++ b/xlators/nfs/server/src/nfs3.c @@ -2868,11 +2868,15 @@ nfs3svc_remove_cbk (call_frame_t *frame, void *cookie, xlator_t *this, nfs3_fdcache_remove (nfs3, openfd); } + /* This is the unref equivalent of the ref done when the inode was + * created on a lookup or a create request. + * The inode is finally unrefed in call state wipe. + */ + inode_unref (cs->resolvedloc.inode); do_not_unref_cached_fd: nfs3_log_common_res (rpcsvc_request_xid (cs->req), "REMOVE", stat, op_errno); nfs3_remove_reply (cs->req, stat, preparent, postparent); - inode_unref (cs->resolvedloc.inode); nfs3_call_state_wipe (cs); return 0; -- cgit