From ab5c5610bb37e5f4fbcc4722abf21de3dc2c9679 Mon Sep 17 00:00:00 2001 From: Csaba Henk Date: Sat, 20 Nov 2010 05:52:24 +0000 Subject: volgen: put back an amended form of check erased in 96f44835 ("do not error out if brick count is less than sub count...") Signed-off-by: Csaba Henk Signed-off-by: Anand V. Avati BUG: 2054 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2054 --- xlators/mgmt/glusterd/src/glusterd-volgen.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'xlators/mgmt/glusterd') diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index 110008eb072..ecd411127af 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.c +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c @@ -1109,6 +1109,16 @@ client_graph_builder (glusterfs_graph_t *graph, glusterd_volinfo_t *volinfo, return -1; } + if (volinfo->sub_count && volinfo->sub_count < volinfo->brick_count && + volinfo->brick_count % volinfo->sub_count != 0) { + gf_log ("", GF_LOG_ERROR, + "volume inconsistency: " + "total number of bricks (%d) is not divisible with ", + "number of bricks per cluster (%d) in a multi-cluster " + "setup", + volinfo->brick_count, volinfo->sub_count); + return -1; + } i = 0; list_for_each_entry (brick, &volinfo->bricks, brick_list) { -- cgit