summaryrefslogtreecommitdiffstats
path: root/xlators/features/trash
diff options
context:
space:
mode:
authorvmallika <vmallika@redhat.com>2015-11-02 15:39:46 +0530
committerRaghavendra G <rgowdapp@redhat.com>2015-11-09 03:12:55 -0800
commit9380b1d1fb74cd73d306a1a501e4b7b982c1a76e (patch)
treeb2f0dbc733a166ff9e7ec548bfa59aff9321305d /xlators/features/trash
parent87c877c93c399863b6afcc642d015627217b79f8 (diff)
marker: do remove xattr only for last link
This is a backport of http://review.gluster.org/#/c/12033/ 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 <vmallika@redhat.com> Change-Id: Icf5fdd86bbb8eef0adeb9518e89e5b612e9e0705 BUG: 1279331 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/12549 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/features/trash')
-rw-r--r--xlators/features/trash/src/trash.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/xlators/features/trash/src/trash.c b/xlators/features/trash/src/trash.c
index ab008651e1a..c2d36bd37d7 100644
--- a/xlators/features/trash/src/trash.c
+++ b/xlators/features/trash/src/trash.c
@@ -840,7 +840,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
*
*/
@@ -848,16 +848,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 ();
@@ -868,12 +868,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,
@@ -1091,7 +1091,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;