From 126e4fa58119c76ff78a5af88237a61ab0662531 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Tue, 1 Nov 2011 22:45:12 +0530 Subject: glusterd rebalance: fail rebalance command on non-distribute volumes Change-Id: Id8cf3cbc8297b5f24f67c152d789b7c2ac299ccc BUG: 3729 Reviewed-on: http://review.gluster.com/652 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/mgmt/glusterd/src/glusterd-rebalance.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'xlators') diff --git a/xlators/mgmt/glusterd/src/glusterd-rebalance.c b/xlators/mgmt/glusterd/src/glusterd-rebalance.c index 1e63ada9375..45aa3c2bf9f 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); -- cgit