summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-rebalance.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-rebalance.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-rebalance.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-rebalance.c b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
index b1eed64195f..55a2e45e2ca 100644
--- a/xlators/mgmt/glusterd/src/glusterd-rebalance.c
+++ b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
@@ -275,8 +275,10 @@ glusterd_defrag_start (void *data)
/* Step 1: Fix layout of all the directories */
ret = gf_glusterd_rebalance_fix_layout (volinfo, defrag->mount);
- if (ret)
+ if (ret) {
+ volinfo->defrag_status = GF_DEFRAG_STATUS_FAILED;
goto out;
+ }
/* Completed first step */
volinfo->defrag_status = GF_DEFRAG_STATUS_LAYOUT_FIX_COMPLETE;
@@ -286,9 +288,14 @@ glusterd_defrag_start (void *data)
/* Step 2: Iterate over directories to move data */
ret = gf_glusterd_rebalance_move_data (volinfo, defrag->mount);
+ if (ret) {
+ volinfo->defrag_status = GF_DEFRAG_STATUS_FAILED;
+ }
/* Completed whole process */
- volinfo->defrag_status = GF_DEFRAG_STATUS_COMPLETE;
+ if (!ret) {
+ volinfo->defrag_status = GF_DEFRAG_STATUS_COMPLETE;
+ }
volinfo->rebalance_files = defrag->total_files;
volinfo->rebalance_data = defrag->total_data;
volinfo->lookedup_files = defrag->num_files_lookedup;