summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaushal M <kaushal@redhat.com>2012-06-05 15:02:49 +0530
committerAnand Avati <avati@redhat.com>2012-06-05 10:44:35 -0700
commit04fd2972fe8a9b9568ac781ba7677f13fdce0f57 (patch)
tree059cff0c76b7c616d85de3780ff896d2bb4f3a1e
parent0baa65b651036ada96d9fc190232e4f100dc12e8 (diff)
glusterd: Set errstr for duplicate add-brick
Sets op_errstr when add-brick is given a duplicate brick. Change-Id: I7b8f8139f9f09834a71a5abc725692b145896830 BUG: 803336 Signed-off-by: Kaushal M <kaushal@redhat.com> Reviewed-on: http://review.gluster.com/3519 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Anand Avati <avati@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 55554fe6ee4..f5181f3673a 100644
--- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
@@ -1141,6 +1141,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 {