d1681e
From 058d12fcab16688cd351bd9d409a83cae40c3ea6 Mon Sep 17 00:00:00 2001
d1681e
From: Atin Mukherjee <amukherj@redhat.com>
d1681e
Date: Tue, 10 Jul 2018 21:33:41 +0530
d1681e
Subject: [PATCH 320/325] glusterd: log improvements on brick creation
d1681e
 validation
d1681e
d1681e
Added few log entries in glusterd_is_brickpath_available ().
d1681e
d1681e
>Change-Id: I8b758578f9db90d2974f7c79126c50ad3a001d71
d1681e
>Updates: bz#1193929
d1681e
>Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
d1681e
d1681e
upstream patch: https://review.gluster.org/#/c/20493/
d1681e
d1681e
Change-Id: I8b758578f9db90d2974f7c79126c50ad3a001d71
d1681e
BUG: 1599823
d1681e
Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
d1681e
Reviewed-on: https://code.engineering.redhat.com/gerrit/143744
d1681e
Tested-by: RHGS Build Bot <nigelb@redhat.com>
d1681e
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
d1681e
---
d1681e
 xlators/mgmt/glusterd/src/glusterd-utils.c | 17 +++++++++++++++--
d1681e
 1 file changed, 15 insertions(+), 2 deletions(-)
d1681e
d1681e
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
d1681e
index 565b6c5..95df889 100644
d1681e
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
d1681e
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
d1681e
@@ -1282,7 +1282,8 @@ glusterd_brickinfo_new_from_brick (char *brick,
d1681e
                                         GD_MSG_BRICKINFO_CREATE_FAIL, "realpath"
d1681e
                                         " () failed for brick %s. The "
d1681e
                                         "underlying filesystem may be in bad "
d1681e
-                                        "state", new_brickinfo->path);
d1681e
+                                        "state. Error - %s",
d1681e
+                                        new_brickinfo->path, strerror(errno));
d1681e
                                 ret = -1;
d1681e
                                 goto out;
d1681e
                         }
d1681e
@@ -1367,6 +1368,12 @@ glusterd_is_brickpath_available (uuid_t uuid, char *path)
d1681e
         /* path may not yet exist */
d1681e
         if (!realpath (path, tmp_path)) {
d1681e
                 if (errno != ENOENT) {
d1681e
+                        gf_msg (THIS->name, GF_LOG_CRITICAL, errno,
d1681e
+                                        GD_MSG_BRICKINFO_CREATE_FAIL, "realpath"
d1681e
+                                        " () failed for brick %s. The "
d1681e
+                                        "underlying filesystem may be in bad "
d1681e
+                                        "state. Error - %s",
d1681e
+                                        path, strerror(errno));
d1681e
                         goto out;
d1681e
                 }
d1681e
                 /* When realpath(3) fails, tmp_path is undefined. */
d1681e
@@ -1378,8 +1385,14 @@ glusterd_is_brickpath_available (uuid_t uuid, char *path)
d1681e
                                          brick_list) {
d1681e
                         if (gf_uuid_compare (uuid, brickinfo->uuid))
d1681e
                                 continue;
d1681e
-                        if (_is_prefix (brickinfo->real_path, tmp_path))
d1681e
+                        if (_is_prefix (brickinfo->real_path, tmp_path)) {
d1681e
+                                gf_msg (THIS->name, GF_LOG_CRITICAL, 0,
d1681e
+                                        GD_MSG_BRICKINFO_CREATE_FAIL,
d1681e
+                                        "_is_prefix call failed for brick %s "
d1681e
+                                        "against brick %s", tmp_path,
d1681e
+                                        brickinfo->real_path);
d1681e
                                 goto out;
d1681e
+                        }
d1681e
                 }
d1681e
         }
d1681e
         available = _gf_true;
d1681e
-- 
d1681e
1.8.3.1
d1681e