From 2e18269a80f5f0f0d8d28813aaf216cdb4477a9a Mon Sep 17 00:00:00 2001 From: Atin Mukherjee Date: Tue, 10 Jul 2018 21:33:41 +0530 Subject: glusterd: log improvements on brick creation validation Added few log entries in glusterd_is_brickpath_available (). Change-Id: I8b758578f9db90d2974f7c79126c50ad3a001d71 Updates: bz#1193929 Signed-off-by: Atin Mukherjee --- xlators/mgmt/glusterd/src/glusterd-utils.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'xlators/mgmt') diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 385df1ea01b..45fb4c67e87 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -1282,7 +1282,8 @@ glusterd_brickinfo_new_from_brick (char *brick, GD_MSG_BRICKINFO_CREATE_FAIL, "realpath" " () failed for brick %s. The " "underlying filesystem may be in bad " - "state", new_brickinfo->path); + "state. Error - %s", + new_brickinfo->path, strerror(errno)); ret = -1; goto out; } @@ -1358,6 +1359,12 @@ glusterd_is_brickpath_available (uuid_t uuid, char *path) /* path may not yet exist */ if (!realpath (path, tmp_path)) { if (errno != ENOENT) { + gf_msg (THIS->name, GF_LOG_CRITICAL, errno, + GD_MSG_BRICKINFO_CREATE_FAIL, "realpath" + " () failed for brick %s. The " + "underlying filesystem may be in bad " + "state. Error - %s", + path, strerror(errno)); goto out; } /* When realpath(3) fails, tmp_path is undefined. */ @@ -1369,8 +1376,14 @@ glusterd_is_brickpath_available (uuid_t uuid, char *path) brick_list) { if (gf_uuid_compare (uuid, brickinfo->uuid)) continue; - if (_is_prefix (brickinfo->real_path, tmp_path)) + if (_is_prefix (brickinfo->real_path, tmp_path)) { + gf_msg (THIS->name, GF_LOG_CRITICAL, 0, + GD_MSG_BRICKINFO_CREATE_FAIL, + "_is_prefix call failed for brick %s " + "against brick %s", tmp_path, + brickinfo->real_path); goto out; + } } } available = _gf_true; -- cgit