diff options
author | Shehjar Tikoo <shehjart@gluster.com> | 2010-05-13 06:59:19 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-05-13 12:12:02 -0700 |
commit | 9bdda4ce0aaebb3f8109152f056d9b35229fb708 (patch) | |
tree | 6875513ab9988191df1d745fd4120dfeec2392e2 /xlators/nfs/server/src/nfs3.c | |
parent | 40c53115e312a7b5b5bc0b7cf880820bc8e7c8e1 (diff) |
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 <shehjart@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 857 (Crash in afr_sh_entry_expunge_entry_cbk)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=857
Diffstat (limited to 'xlators/nfs/server/src/nfs3.c')
-rw-r--r-- | xlators/nfs/server/src/nfs3.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/xlators/nfs/server/src/nfs3.c b/xlators/nfs/server/src/nfs3.c index 7a1a0fc3d50..b5db1b96628 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; |