From ab88f655e6423f51e2f2fac9265ff4d4f5c3e579 Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Thu, 27 Apr 2017 11:53:24 +0530 Subject: cluster/dht: Pass the correct xdata in fremovexattr fop Change-Id: Id84bc87e48f435573eba3b24d3fb3c411fd2445d BUG: 1440051 Signed-off-by: Krutika Dhananjay Reviewed-on: https://review.gluster.org/17126 Smoke: Gluster Build System CentOS-regression: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Raghavendra G --- xlators/cluster/dht/src/dht-common.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'xlators/cluster/dht') diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index 7e5d727104e..ae7851798ab 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -4569,6 +4569,7 @@ dht_fremovexattr (call_frame_t *frame, xlator_t *this, op_errno = EINVAL; goto err; } + local->xattr_req = xdata ? dict_ref (xdata) : dict_new (); local->call_cnt = call_cnt = layout->cnt; local->key = gf_strdup (key); @@ -4579,15 +4580,13 @@ dht_fremovexattr (call_frame_t *frame, xlator_t *this, layout->list[i].xlator, layout->list[i].xlator, layout->list[i].xlator->fops->fremovexattr, - fd, key, NULL); + fd, key, local->xattr_req); } } else { local->call_cnt = 1; - xdata = xdata ? dict_ref (xdata) : dict_new (); - if (xdata) - ret = dict_set_int8 (xdata, DHT_IATT_IN_XDATA_KEY, 1); + ret = dict_set_int8 (local->xattr_req, DHT_IATT_IN_XDATA_KEY, 1); if (ret) { gf_msg (this->name, GF_LOG_ERROR, ENOMEM, DHT_MSG_DICT_SET_FAILED, "Failed to " @@ -4597,10 +4596,7 @@ dht_fremovexattr (call_frame_t *frame, xlator_t *this, STACK_WIND_COOKIE (frame, dht_file_removexattr_cbk, subvol, subvol, subvol->fops->fremovexattr, fd, key, - xdata); - - if (xdata) - dict_unref (xdata); + local->xattr_req); } return 0; -- cgit