summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-selfheal.c
diff options
context:
space:
mode:
authorroot <root@localhost.localdomain>2019-04-07 19:31:17 +0530
committerN Balachandran <nbalacha@redhat.com>2019-05-08 03:43:20 +0000
commitaa52259de7b50625b754ce9fb5c0f38e22d79dd6 (patch)
treeeeaadb9840e55b773a94d558c7dcdbcea152f0b8 /xlators/cluster/dht/src/dht-selfheal.c
parentbbb87ee8a433949eea8b3a2f0bef152ead37ccd7 (diff)
dht: Custom xattrs are not healed in case of add-brick
Problem: If any custom xattrs are set on the directory before add a brick, xattrs are not healed on the directory after adding a brick. Solution: xattr are not healed because dht_selfheal_dir_mkdir_lookup_cbk checks the value of MDS and if MDS value is not negative selfheal code path does not take reference of MDS xattrs.Change the condition to take reference of MDS xattr so that custom xattrs are populated on newly added brick Updates: bz#1702299 Change-Id: Id14beedb98cce6928055f294e1594b22132e811c Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-selfheal.c')
-rw-r--r--xlators/cluster/dht/src/dht-selfheal.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c
index 5420fca..f5dfff9 100644
--- a/xlators/cluster/dht/src/dht-selfheal.c
+++ b/xlators/cluster/dht/src/dht-selfheal.c
@@ -1310,12 +1310,8 @@ dht_selfheal_dir_mkdir_lookup_cbk(call_frame_t *frame, void *cookie,
int this_call_cnt = 0;
int missing_dirs = 0;
dht_layout_t *layout = NULL;
- dht_conf_t *conf = 0;
xlator_t *prev = 0;
loc_t *loc = NULL;
- int check_mds = 0;
- int errst = 0;
- int32_t mds_xattr_val[1] = {0};
char gfid_local[GF_UUID_BUF_SIZE] = {0};
int index = -1;
@@ -1324,7 +1320,6 @@ dht_selfheal_dir_mkdir_lookup_cbk(call_frame_t *frame, void *cookie,
local = frame->local;
layout = local->layout;
loc = &local->loc;
- conf = this->private;
prev = cookie;
if (!gf_uuid_is_null(local->gfid))
@@ -1347,9 +1342,7 @@ dht_selfheal_dir_mkdir_lookup_cbk(call_frame_t *frame, void *cookie,
if (!op_ret) {
dht_iatt_merge(this, &local->stbuf, stbuf);
- check_mds = dht_dict_get_array(xattr, conf->mds_xattr_key,
- mds_xattr_val, 1, &errst);
- if (dict_get(xattr, conf->mds_xattr_key) && check_mds && !errst) {
+ if (prev == local->mds_subvol) {
dict_unref(local->xattr);
local->xattr = dict_ref(xattr);
}