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, 11 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-rebalance.c b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
index 1e63ada93..45aa3c2bf 100644
--- a/xlators/mgmt/glusterd/src/glusterd-rebalance.c
+++ b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
@@ -744,6 +744,17 @@ glusterd_rebalance_cmd_validate (int cmd, char *volname,
"be started to perform rebalance", volname);
goto out;
}
+
+ if ((*volinfo)->brick_count <= (((*volinfo)->sub_count) ?
+ (*volinfo)->sub_count : 1)) {
+ /* distribute translator is not involved, no use of
+ rebalancing */
+ snprintf (op_errstr, len, "nothing to rebalance on volume %s",
+ volname);
+ gf_log (THIS->name, GF_LOG_WARNING, "%s", op_errstr);
+ goto out;
+ }
+
ret = 0;
out:
gf_log ("glusterd", GF_LOG_DEBUG, "Returning %d", ret);