From 356d46b13031be82cc2e0b0eaad7e7fcfccc7c35 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 7 Apr 2019 19:31:17 +0530 Subject: 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 Backport of: > Patch: https://review.gluster.org/22520 > BUG: bz#1702299 > Change-Id: Id14beedb98cce6928055f294e1594b22132e811c > Signed-off-by: Mohit Agrawal fixes: bz#1753561 Change-Id: Id14beedb98cce6928055f294e1594b22132e811c Signed-off-by: Kotresh HR --- xlators/cluster/dht/src/dht-selfheal.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'xlators') diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c index 5420fcad071..f5dfff9a11f 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); } -- cgit