]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore/KernelDevice: note EIO metadata on aio EIO
authorSage Weil <sage@redhat.com>
Thu, 4 Apr 2019 19:47:17 +0000 (14:47 -0500)
committerSage Weil <sage@redhat.com>
Mon, 8 Apr 2019 14:29:00 +0000 (09:29 -0500)
Note that we only do this if we're about to induce a crash.  If we can
pass EIO up the stack, it's up to the upper layer to handle it or trigger
its own crash if it can't.

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 145333576c49eb591af7aef954d4039dcde471e4)

src/os/bluestore/KernelDevice.cc

index 5812d84b1774121143adb22eb61a5cfb174f9a93..8f7d9b56bee86eddf36ad6046bc793e02a7f395d 100644 (file)
@@ -32,6 +32,8 @@
 #include "common/align.h"
 #include "common/numa.h"
 
+#include "global/global_context.h"
+
 #define dout_context cct
 #define dout_subsys ceph_subsys_bdev
 #undef dout_prefix
@@ -514,13 +516,27 @@ void KernelDevice::_aio_thread()
                 << dendl;
             ioc->set_return_value(-EIO);
           } else {
-            ceph_assert(0 == "got unexpected error from aio_t::get_return_value. "
-                       "This may suggest HW issue. Please check your dmesg!");
+           if (is_expected_ioerr(r)) {
+             note_io_error_event(
+               devname.c_str(),
+               path.c_str(),
+               r,
+               aio[i]->iocb.aio_lio_opcode,
+               aio[i]->offset,
+               aio[i]->length);
+             ceph_abort_msg(
+               "Unexpected IO error. "
+               "This may suggest a hardware issue. "
+               "Please check your kernel log!");
+           }
+           ceph_abort_msg(
+             "Unexpected IO error. "
+             "This may suggest HW issue. Please check your dmesg!");
           }
         } else if (aio[i]->length != (uint64_t)r) {
           derr << "aio to " << aio[i]->offset << "~" << aio[i]->length
                << " but returned: " << r << dendl;
-          ceph_abort_msg("unexpected aio error");
+          ceph_abort_msg("unexpected aio return value: does not match length");
         }
 
         dout(10) << __func__ << " finished aio " << aio[i] << " r " << r