diff options
author | Amar Tumballi <amar@gluster.com> | 2010-11-15 03:46:30 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-11-15 04:04:00 -0800 |
commit | 6d42bc03d0ebe6100d9f3815f06637cb1b44c2ac (patch) | |
tree | 6427594bf96fd99714ef972f611462190f371063 /xlators/mgmt/glusterd/src | |
parent | 553c15160e4e3b063f4b689ee762b6d14be9953b (diff) |
glusterd rebalance: update the status in failure cases
Signed-off-by: Amar Tumballi <amar@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 1999 ()
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1999
Diffstat (limited to 'xlators/mgmt/glusterd/src')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-rebalance.c | 11 |
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 b1eed6419..55a2e45e2 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; |