summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorJoseph Fernandes <josferna@redhat.com>2016-05-02 16:20:30 +0530
committerDan Lambright <dlambrig@redhat.com>2016-05-06 13:11:38 -0700
commit9aec39440229d48256938b67e738302400d52f08 (patch)
tree2efff603e5725a82b60eb09bd778ad5454c642f9 /xlators
parentd1e0200f7dbbc412b8fc0127be2324beaade1c78 (diff)
tier/detach : During detach check if background fixlayout is done
During detach check if background fixlayout is done, if not done ignore the case and continue detach. Backport of http://review.gluster.org/14147 > Change-Id: I5d5cfc0e73d0eb217fdeab54c432dc4af8bc598d > BUG: 1332136 > Signed-off-by: Joseph Fernandes <josferna@redhat.com> > Reviewed-on: http://review.gluster.org/14147 > Smoke: Gluster Build System <jenkins@build.gluster.com> > NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> > CentOS-regression: Gluster Build System <jenkins@build.gluster.com> > Reviewed-by: N Balachandran <nbalacha@redhat.com> > Reviewed-by: Dan Lambright <dlambrig@redhat.com> > Signed-off-by: Joseph Fernandes <josferna@redhat.com> Change-Id: I16f0320a2c07ac1d137bd4f27697722049df803c BUG: 1333803 Signed-off-by: Joseph Fernandes <josferna@redhat.com> Reviewed-on: http://review.gluster.org/14241 Smoke: Gluster Build System <jenkins@build.gluster.com> Tested-by: Joseph Fernandes NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Niels de Vos <ndevos@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/dht/src/dht-rebalance.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c
index d4ca6e0c2b5..0a84f2a74c2 100644
--- a/xlators/cluster/dht/src/dht-rebalance.c
+++ b/xlators/cluster/dht/src/dht-rebalance.c
@@ -3388,7 +3388,20 @@ out:
int
gf_tier_clear_fix_layout (xlator_t *this, loc_t *loc, gf_defrag_info_t *defrag)
{
- int ret = -1;
+ int ret = -1;
+ dict_t *dict = NULL;
+
+ /* Check if background fixlayout is completed. */
+ ret = syncop_getxattr (this, loc, &dict,
+ GF_XATTR_TIER_LAYOUT_FIXED_KEY, NULL, NULL);
+ if (ret) {
+ /* Background fixlayout not complete - nothing to clear*/
+ gf_log (this->name, GF_LOG_WARNING,
+ "Unable to retrieve fixlayout xattr."
+ "Assume background fix layout not complete");
+ ret = 0;
+ goto out;
+ }
ret = syncop_removexattr (this, loc, GF_XATTR_TIER_LAYOUT_FIXED_KEY,
NULL, NULL);
@@ -3402,6 +3415,8 @@ gf_tier_clear_fix_layout (xlator_t *this, loc_t *loc, gf_defrag_info_t *defrag)
}
ret = 0;
out:
+ if (dict)
+ dict_unref (dict);
return ret;
}