diff options
Diffstat (limited to 'xlators/cluster/dht/src/dht-rebalance.c')
-rw-r--r-- | xlators/cluster/dht/src/dht-rebalance.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c index 4653ae798c1..087d67ad891 100644 --- a/xlators/cluster/dht/src/dht-rebalance.c +++ b/xlators/cluster/dht/src/dht-rebalance.c @@ -4091,21 +4091,40 @@ dht_get_local_subvols_and_nodeuuids (xlator_t *this, dht_conf_t *conf, loc_t *loc) { - dict_t *dict = NULL; - int ret = -1; + dict_t *dict = NULL; + gf_defrag_info_t *defrag = NULL; + int ret = -1; + + defrag = conf->defrag; + if (defrag->cmd != GF_DEFRAG_CMD_START_TIER) { /* Find local subvolumes */ + ret = syncop_getxattr (this, loc, &dict, + GF_REBAL_FIND_LOCAL_SUBVOL, + NULL, NULL); + if (ret && (ret != -ENODATA)) { + + gf_msg (this->name, GF_LOG_ERROR, -ret, 0, "local " + "subvolume determination failed with error: %d", + -ret); + ret = -1; + goto out; + } + + if (!ret) + goto out; + } + ret = syncop_getxattr (this, loc, &dict, - GF_REBAL_FIND_LOCAL_SUBVOL, + GF_REBAL_OLD_FIND_LOCAL_SUBVOL, NULL, NULL); if (ret) { - gf_msg (this->name, GF_LOG_ERROR, 0, 0, "local " + gf_msg (this->name, GF_LOG_ERROR, -ret, 0, "local " "subvolume determination failed with error: %d", -ret); ret = -1; goto out; } - ret = 0; out: return ret; |