summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaushal M <kaushal@redhat.com>2012-06-05 15:02:49 +0530
committerVijay Bellur <vbellur@redhat.com>2012-08-01 20:39:18 -0700
commitf2b709054d6eec89760bb3513f7b27209c6a6ea7 (patch)
treee8386c504994d2ed01a101b4f71ebd94c1e4944a
parentb8d5208f5c8945debe565ae72fea5a3795a44dfe (diff)
glusterd: Set errstr for duplicate add-brick
Sets op_errstr when add-brick is given a duplicate brick. BUG: 832293 Change-Id: I2d6d13b2ca29615678902b56e6b394ea05f37923 Signed-off-by: Kaushal M <kaushal@redhat.com> Reviewed-on: http://review.gluster.com/3585 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-brick-ops.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
index 120fd50..aba6ac2 100644
--- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
@@ -1139,6 +1139,9 @@ glusterd_op_stage_add_brick (dict_t *dict, char **op_errstr)
if (!ret) {
gf_log (THIS->name, GF_LOG_ERROR,
"Adding duplicate brick: %s", brick);
+ snprintf (msg, sizeof (msg), "Brick %s is already a "
+ "part of the volume", brick);
+ *op_errstr = gf_strdup (msg);
ret = -1;
goto out;
} else {