diff options
| author | Amar Tumballi <amar@gluster.com> | 2011-11-01 22:45:12 +0530 | 
|---|---|---|
| committer | Vijay Bellur <vijay@gluster.com> | 2011-11-03 06:15:18 -0700 | 
| commit | 126e4fa58119c76ff78a5af88237a61ab0662531 (patch) | |
| tree | bd26ad194b2be7366b188ec1d62c61389382320f | |
| parent | a2a3906d76a4c3b2490a49ae694efd9ee3684b7c (diff) | |
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 <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
| -rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-rebalance.c | 11 | 
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);  | 
