summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendrabhat@gluster.com>2010-10-04 10:59:08 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-10-04 09:48:43 -0700
commit98d51842863d52bab2674258c3ec12d668139539 (patch)
tree1e8207f259848bb2d157843b4e9c716779afb1c4 /xlators
parentb6fea1abc756c31d93244263a654b56f2f8b7894 (diff)
initialize the list earlier while handling create volume and add brick
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1726 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1726
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handler.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index 6e3916708..d644c0c02 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
@@ -706,6 +706,8 @@ glusterd_handle_create_volume (rpcsvc_request_t *req)
priv = this->private;
+ INIT_LIST_HEAD (&tmpvolinfo.bricks);
+
if (!gf_xdr_to_cli_create_vol_req (req->msg[0], &cli_req)) {
//failed to decode msg;
req->rpc_err = GARBAGE_ARGS;
@@ -784,7 +786,7 @@ glusterd_handle_create_volume (rpcsvc_request_t *req)
((cli_req.type == 1)? "STRIPE":"REPLICATE")), cli_req.count,
bricks);
- INIT_LIST_HEAD (&tmpvolinfo.bricks);
+
while ( i < brick_count) {
i++;
brick= strtok_r (brick_list, " \n", &tmpptr);
@@ -967,6 +969,8 @@ glusterd_handle_add_brick (rpcsvc_request_t *req)
GF_ASSERT (req);
+ INIT_LIST_HEAD (&tmpvolinfo.bricks);
+
if (!gf_xdr_to_cli_add_brick_req (req->msg[0], &cli_req)) {
//failed to decode msg;
req->rpc_err = GARBAGE_ARGS;
@@ -1065,7 +1069,7 @@ brick_val:
,volname, ((volinfo->type == 0)? "DEFAULT" : ((volinfo->type
== 1)? "STRIPE": "REPLICATE")), brick_count, brick_list);
- INIT_LIST_HEAD (&tmpvolinfo.bricks);
+
while ( i < brick_count) {
i++;
brick= strtok_r (brick_list, " \n", &tmpptr);