From e0e34d04aa68ac154818b55e7c337607fb141971 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Wed, 20 Mar 2013 18:48:12 +0100 Subject: glusterd: Improve error logging when a brick from an old volume gets re-used The error message when creating a volume that contains a brick with certain xatts set on a parent directory is unclear. Users do not understand '... or a prefix of it is already part of a volume'. Most users check the final directory that is used for a brick, but not its parents. It would be helpful to present the user with the actual directory that is preventing the volume to use the brick. BUG: 923917 Change-Id: I815ad32a992eb0e41ee8fca6ee9327400d042c45 Signed-off-by: Niels de Vos Reviewed-on: http://review.gluster.org/4701 Tested-by: Gluster Build System Reviewed-by: Jeff Darcy --- xlators/mgmt/glusterd/src/glusterd-utils.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 09e3ff669..e3099981f 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -5120,8 +5120,13 @@ out: } if (*in_use) { - snprintf (msg, sizeof (msg), "%s or a prefix of it is " - "already part of a volume", path); + if (!strcmp (path, curdir)) { + snprintf (msg, sizeof (msg), "%s is already part of a " + "volume", path); + } else { + snprintf (msg, sizeof (msg), "parent directory %s is " + "already part of a volume", curdir); + } } if (strlen (msg)) { -- cgit