Patchwork [BUG:3123] glusterd: check replica_count for 0 before using it for volume creation in stripe replicate volume

login
register
Submitter Raghavendra Bhat
Date 2011-07-04 07:57:06
Message ID <20110704075706.GA15996@shell.gluster.com>
Download mbox | patch
Permalink /patch/7743/
State Accepted
Delegated to: Amar Tumballi
Headers show

Comments

Raghavendra Bhat - 2011-07-04 07:57:06
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com>
---
 xlators/mgmt/glusterd/src/glusterd-volgen.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Patch

diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index aa16128..6a6b7e4 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -1593,6 +1593,8 @@  client_graph_builder (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
                         break;
                 case GF_CLUSTER_TYPE_STRIPE_REPLICATE:
                         /* Replicate after the clients, then stripe */
+                        if (volinfo->replica_count == 0)
+                                return -1;
                         sub_count = volinfo->replica_count;
                         cluster_args = replicate_args;
                         break;