cluster/afr: Thin-arbiter SHD fixes
This patch address post-merge review comments for commit 5784a00f997212d34bd52b2303e20c097240d91c Change-Id: I7ed954664a2ae8e1091d23ee3ceb9c66e83bfeac fixes: bz#1699319 Signed-off-by: karthik-us <ksubrahm@redhat.com>
This commit is contained in:
parent
fbba6e397f
commit
6bd52e5108
@ -590,7 +590,9 @@ _afr_shd_ta_get_xattrs(xlator_t *this, loc_t *loc, dict_t **xdata)
|
||||
{
|
||||
afr_private_t *priv = NULL;
|
||||
dict_t *xattr = NULL;
|
||||
int *raw = NULL;
|
||||
int raw[AFR_NUM_CHANGE_LOGS] = {
|
||||
0,
|
||||
};
|
||||
int ret = -1;
|
||||
int i = 0;
|
||||
|
||||
@ -602,18 +604,11 @@ _afr_shd_ta_get_xattrs(xlator_t *this, loc_t *loc, dict_t **xdata)
|
||||
"Failed to create dict.");
|
||||
goto out;
|
||||
}
|
||||
|
||||
for (i = 0; i < priv->child_count; i++) {
|
||||
raw = GF_CALLOC(AFR_NUM_CHANGE_LOGS, sizeof(int), gf_afr_mt_int32_t);
|
||||
if (!raw)
|
||||
ret = dict_set_static_bin(xattr, priv->pending_key[i], &raw,
|
||||
AFR_NUM_CHANGE_LOGS * sizeof(int));
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
ret = dict_set_bin(xattr, priv->pending_key[i], raw,
|
||||
AFR_NUM_CHANGE_LOGS * sizeof(int));
|
||||
if (ret) {
|
||||
GF_FREE(raw);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
ret = syncop_xattrop(priv->children[THIN_ARBITER_BRICK_INDEX], loc,
|
||||
@ -640,6 +635,7 @@ afr_shd_ta_get_xattrs(xlator_t *this, loc_t *loc, struct subvol_healer *healer,
|
||||
if (afr_shd_fill_ta_loc(this, loc)) {
|
||||
gf_msg(this->name, GF_LOG_ERROR, -ret, AFR_MSG_THIN_ARB,
|
||||
"Failed to populate thin-arbiter loc for: %s.", loc->name);
|
||||
ret = -1;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@ -854,9 +850,13 @@ afr_shd_index_healer(void *data)
|
||||
sleep(1);
|
||||
} while (ret > 0);
|
||||
|
||||
if (pre_crawl_xdata && !healer->crawl_event.heal_failed_count) {
|
||||
if (ret == 0 && pre_crawl_xdata &&
|
||||
!healer->crawl_event.heal_failed_count) {
|
||||
afr_shd_ta_check_and_unset_xattrs(this, &loc, healer,
|
||||
pre_crawl_xdata);
|
||||
}
|
||||
|
||||
if (pre_crawl_xdata) {
|
||||
dict_unref(pre_crawl_xdata);
|
||||
pre_crawl_xdata = NULL;
|
||||
}
|
||||
|
@ -368,7 +368,7 @@ afr_ta_init(afr_private_t *priv)
|
||||
priv->release_ta_notify_dom_lock = _gf_false;
|
||||
INIT_LIST_HEAD(&priv->ta_waitq);
|
||||
INIT_LIST_HEAD(&priv->ta_onwireq);
|
||||
*priv->ta_gfid = 0;
|
||||
gf_uuid_clear(priv->ta_gfid);
|
||||
}
|
||||
|
||||
int32_t
|
||||
|
Loading…
x
Reference in New Issue
Block a user