From 04fd2972fe8a9b9568ac781ba7677f13fdce0f57 Mon Sep 17 00:00:00 2001 From: Kaushal M Date: Tue, 5 Jun 2012 15:02:49 +0530 Subject: 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 Reviewed-on: http://review.gluster.com/3519 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Anand Avati --- xlators/mgmt/glusterd/src/glusterd-brick-ops.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'xlators') diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c index 55554fe6e..f5181f367 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 { -- cgit