17b94a
From 243075b593c6fccbffb3e82ffcfdb58acfd68269 Mon Sep 17 00:00:00 2001
17b94a
From: Mohit Agrawal <moagrawal@redhat.com>
17b94a
Date: Thu, 22 Aug 2019 15:51:43 +0530
17b94a
Subject: [PATCH 284/284] posix: log aio_error return codes in
17b94a
 posix_fs_health_check
17b94a
17b94a
Problem: Sometime brick is going down to health check thread is
17b94a
         failed without logging error codes return by aio system calls.
17b94a
         As per aio_error man page it returns a positive error number
17b94a
         if the asynchronous I/O operation failed.
17b94a
17b94a
Solution: log aio_error return codes in error message
17b94a
17b94a
> Change-Id: I2496b1bc16e602b0fd3ad53e211de11ec8c641ef
17b94a
> Fixes: bz#1744519
17b94a
> Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
17b94a
> Reviewed on upstream link https://review.gluster.org/#/c/glusterfs/+/23284/
17b94a
17b94a
Change-Id: I2496b1bc16e602b0fd3ad53e211de11ec8c641ef
17b94a
BUG: 1744518
17b94a
Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
17b94a
Reviewed-on: https://code.engineering.redhat.com/gerrit/179211
17b94a
Tested-by: RHGS Build Bot <nigelb@redhat.com>
17b94a
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
17b94a
---
17b94a
 xlators/storage/posix/src/posix-helpers.c | 5 ++---
17b94a
 1 file changed, 2 insertions(+), 3 deletions(-)
17b94a
17b94a
diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c
17b94a
index ef5bfd5..d143d4c 100644
17b94a
--- a/xlators/storage/posix/src/posix-helpers.c
17b94a
+++ b/xlators/storage/posix/src/posix-helpers.c
17b94a
@@ -2025,7 +2025,6 @@ posix_fs_health_check(xlator_t *this)
17b94a
     if (ret != 0) {
17b94a
         op_errno = errno;
17b94a
         op = "aio_write_error";
17b94a
-        ret = -1;
17b94a
         goto out;
17b94a
     }
17b94a
 
17b94a
@@ -2064,7 +2063,6 @@ posix_fs_health_check(xlator_t *this)
17b94a
     if (ret != 0) {
17b94a
         op_errno = errno;
17b94a
         op = "aio_read_error";
17b94a
-        ret = -1;
17b94a
         goto out;
17b94a
     }
17b94a
 
17b94a
@@ -2089,7 +2087,8 @@ out:
17b94a
     }
17b94a
     if (ret && file_path[0]) {
17b94a
         gf_msg(this->name, GF_LOG_WARNING, errno, P_MSG_HEALTHCHECK_FAILED,
17b94a
-               "%s() on %s returned", op, file_path);
17b94a
+               "%s() on %s returned ret is %d error is %s", op, file_path, ret,
17b94a
+               ret != -1 ? strerror(ret) : strerror(op_errno));
17b94a
         gf_event(EVENT_POSIX_HEALTH_CHECK_FAILED,
17b94a
                  "op=%s;path=%s;error=%s;brick=%s:%s timeout is %d", op,
17b94a
                  file_path, strerror(op_errno), priv->hostname, priv->base_path,
17b94a
-- 
17b94a
1.8.3.1
17b94a