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