From: Sage Weil Date: Thu, 4 Apr 2019 19:47:17 +0000 (-0500) Subject: os/bluestore/KernelDevice: note EIO metadata on aio EIO X-Git-Tag: v15.1.0~3005^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=145333576c49eb591af7aef954d4039dcde471e4;p=ceph.git os/bluestore/KernelDevice: note EIO metadata on aio EIO 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 --- diff --git a/src/os/bluestore/KernelDevice.cc b/src/os/bluestore/KernelDevice.cc index 5812d84b1774..8f7d9b56bee8 100644 --- a/src/os/bluestore/KernelDevice.cc +++ b/src/os/bluestore/KernelDevice.cc @@ -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