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