Blob Blame History Raw
From 0fcc7f8dabf492d2e8190495a51d6626eb2c034a Mon Sep 17 00:00:00 2001
From: Krutika Dhananjay <kdhananj@redhat.com>
Date: Thu, 27 Apr 2017 11:53:24 +0530
Subject: [PATCH 416/426] cluster/dht: Pass the correct xdata in fremovexattr
 fop

        Backport of: https://review.gluster.org/17126

Change-Id: I3aae8a5e1c1cb375f78d33d8081db502abc94d20
BUG: 1434653
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/105210
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
---
 xlators/cluster/dht/src/dht-common.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index 406ec21..962282a 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -4556,6 +4556,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);
@@ -4566,15 +4567,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 "
@@ -4584,10 +4583,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;
-- 
1.8.3.1