From 2794cb71b96c44033dcd01102039c038956cf7b5 Mon Sep 17 00:00:00 2001 From: vmallika Date: Mon, 2 Nov 2015 15:39:46 +0530 Subject: marker: do remove xattr only for last link With unlink, rename, rmdir, contribution xattrs are removed. If the file is a last link then remove_xattr will fail with ENOENT. So it better to perform remove_xattr only if there are more links to the file Change-Id: Ifc1e7fda4d310fd87f6f28a635c9ea78b8f3929d BUG: 1257694 Signed-off-by: vmallika Reviewed-on: http://review.gluster.org/12033 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Manikandan Selvaganesh Reviewed-by: Raghavendra G --- xlators/features/trash/src/trash.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'xlators/features/trash') diff --git a/xlators/features/trash/src/trash.c b/xlators/features/trash/src/trash.c index 35712f98aff..b363dbab825 100644 --- a/xlators/features/trash/src/trash.c +++ b/xlators/features/trash/src/trash.c @@ -836,7 +836,7 @@ trash_unlink_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this, * CTR Xlator. And trash translator only handles the unlink for * the last hardlink. * - * Check if there is a CTR_REQUEST_LINK_COUNT_XDATA from CTR Xlator + * Check if there is a GF_REQUEST_LINK_COUNT_XDATA from CTR Xlator * */ @@ -844,16 +844,16 @@ trash_unlink_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this, /* Sending back inode link count to ctr_unlink * (changetimerecoder xlator) via - * "CTR_RESPONSE_LINK_COUNT_XDATA" key using xdata. + * "GF_RESPONSE_LINK_COUNT_XDATA" key using xdata. * */ if (xdata) { ret = dict_set_uint32 (xdata, - CTR_RESPONSE_LINK_COUNT_XDATA, + GF_RESPONSE_LINK_COUNT_XDATA, 1); if (ret == -1) { gf_log (this->name, GF_LOG_WARNING, "Failed to set" - " CTR_RESPONSE_LINK_COUNT_XDATA"); + " GF_RESPONSE_LINK_COUNT_XDATA"); } } else { new_xdata = dict_new (); @@ -864,12 +864,12 @@ trash_unlink_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this, goto ctr_out; } ret = dict_set_uint32 (new_xdata, - CTR_RESPONSE_LINK_COUNT_XDATA, + GF_RESPONSE_LINK_COUNT_XDATA, 1); if (ret == -1) { gf_log (this->name, GF_LOG_WARNING, "Failed to set" - " CTR_RESPONSE_LINK_COUNT_XDATA"); + " GF_RESPONSE_LINK_COUNT_XDATA"); } ctr_out: TRASH_STACK_UNWIND (unlink, frame, 0, op_errno, @@ -1088,7 +1088,7 @@ trash_unlink (call_frame_t *frame, xlator_t *this, loc_t *loc, int xflags, } /* To know whether CTR xlator requested for the link count */ - ret = dict_get_int32 (xdata, CTR_REQUEST_LINK_COUNT_XDATA, + ret = dict_get_int32 (xdata, GF_REQUEST_LINK_COUNT_XDATA, &ctr_link_req); if (ret) { local->ctr_link_count_req = _gf_false; -- cgit