From e5f241c9f4a9adc969d13288bd823a9a9aa2c469 Mon Sep 17 00:00:00 2001 From: Ashish Pandey Date: Tue, 16 Jun 2015 15:18:50 +0530 Subject: glusterd: Correction in Error message for disperse volume create Problem: If all the bricks are on same server and creating "disperse" volume without using "force", it throws a failure message mentioning "replicate" as volume. Solution: Adding failure message for disperse volume too Change-Id: I9e466b1fe9dae8cf556903b1a2c4f0b270159841 BUG: 1232185 Signed-off-by: Ashish Pandey Reviewed-on: http://review.gluster.org/11251 Tested-by: Gluster Build System Tested-by: NetBSD Build System Reviewed-by: Krishnan Parthasarathi --- xlators/mgmt/glusterd/src/glusterd-volume-ops.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'xlators') diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c index a1aa9595b5e..f95c8280345 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c @@ -101,7 +101,7 @@ glusterd_check_brick_order(dict_t *dict, char *err_str) const char failed_string[2048] = "Failed to perform brick order " "check. Use 'force' at the end of the command" " if you want to override this behavior. "; - const char found_string[2048] = "Multiple bricks of a replicate " + const char found_string[2048] = "Multiple bricks of a %s " "volume are present on the same server. This " "setup is not optimal. Use 'force' at the " "end of the command if you want to override " @@ -248,7 +248,12 @@ check_failed: found_bad_brick_order: gf_msg (this->name, GF_LOG_INFO, 0, GD_MSG_BAD_BRKORDER, "Bad brick order found"); - snprintf (err_str, sizeof (found_string), found_string); + if (type == GF_CLUSTER_TYPE_DISPERSE) { + snprintf (err_str, sizeof (found_string), found_string, "disperse"); + } else { + snprintf (err_str, sizeof (found_string), found_string, "replicate"); + } + ret = -1; out: ai_list_tmp2 = NULL; -- cgit