summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-utils.c
diff options
context:
space:
mode:
authorRajesh Amaravathi <rajesh@redhat.com>2012-01-06 16:02:55 +0530
committerVijay Bellur <vijay@gluster.com>2012-01-12 21:43:24 -0800
commitcf944c8ad5da87bce15b08d0bbb2ecd62e553d86 (patch)
treeb3e31987a3c87677ebfeac914783feefc85b5811 /xlators/mgmt/glusterd/src/glusterd-utils.c
parentbfd429e583f50a4f4712de88dc0a15baadebbf9b (diff)
glusterd: prevent adding bricks already in use
The add-brick command now checks if the brick provided for add-brick is used in any volumes, even if the volume was never started by looping through the brick lists of all volumes. Change-Id: I15035d41d91386448a3e3d4063d909b880288681 BUG: 771831 Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com> Reviewed-on: http://review.gluster.com/2607 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kp@gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index ccb7e8b4be9..bf33e9128ca 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -3812,7 +3812,7 @@ glusterd_new_brick_validate (char *brick, glusterd_brickinfo_t *brickinfo,
if (ret) {
snprintf (op_errstr, len, "Host %s not a friend",
newbrickinfo->hostname);
- gf_log ("glusterd", GF_LOG_ERROR, "%s", op_errstr);
+ gf_log (THIS->name, GF_LOG_ERROR, "%s", op_errstr);
goto out;
}
@@ -3825,7 +3825,7 @@ glusterd_new_brick_validate (char *brick, glusterd_brickinfo_t *brickinfo,
(peerinfo->state.state != GD_FRIEND_STATE_BEFRIENDED)) {
snprintf(op_errstr, len, "Host %s not connected",
newbrickinfo->hostname);
- gf_log ("glusterd", GF_LOG_ERROR, "%s", op_errstr);
+ gf_log (THIS->name, GF_LOG_ERROR, "%s", op_errstr);
ret = -1;
goto out;
}
@@ -3836,7 +3836,7 @@ brick_validation:
if (!ret) {
snprintf(op_errstr, len, "Brick: %s already in use",
brick);
- gf_log ("", GF_LOG_ERROR, "%s", op_errstr);
+ gf_log (THIS->name, GF_LOG_ERROR, "%s", op_errstr);
ret = -1;
goto out;
} else {
@@ -3845,7 +3845,7 @@ brick_validation:
out:
if (is_allocated && newbrickinfo)
glusterd_brickinfo_delete (newbrickinfo);
- gf_log ("", GF_LOG_DEBUG, "returning %d ", ret);
+ gf_log (THIS->name, GF_LOG_DEBUG, "returning %d ", ret);
return ret;
}