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