]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: alter allow_eio policy regarding kernel's error list. 21405/head
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Mon, 9 Apr 2018 14:18:25 +0000 (16:18 +0200)
committerPrashant D <pdhange@redhat.com>
Fri, 13 Apr 2018 05:16:57 +0000 (01:16 -0400)
Fixes: http://tracker.ceph.com/issues/23333
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
(cherry picked from commit 8261e141152af060c1486678b4cb2b65b675a11e)

Conflicts:
src/os/bluestore/KernelDevice.cc: Resolved for is_expected_ioerr

src/os/bluestore/KernelDevice.cc

index 685fa800f1490be42932cfa2fe5cbe5ac1888f37..6c2d5ec1bf16fd719b85df6c1508ee124ac23031 100644 (file)
@@ -338,6 +338,15 @@ void KernelDevice::_aio_stop()
   }
 }
 
+static bool is_expected_ioerr(const int r)
+{
+  // https://lxr.missinglinkelectronics.com/linux+v4.15/block/blk-core.c#L135
+  return (r == -EOPNOTSUPP || r == -ETIMEDOUT || r == -ENOSPC ||
+         r == -ENOLINK || r == -EREMOTEIO || r == -EBADE ||
+         r == -ENODATA || r == -EILSEQ || r == -ENOMEM ||
+         r == -EAGAIN || r == -EREMCHG || r == -EIO);
+}
+
 void KernelDevice::_aio_thread()
 {
   dout(10) << __func__ << " start" << dendl;
@@ -372,9 +381,12 @@ void KernelDevice::_aio_thread()
 
        long r = aio[i]->get_return_value();
         if (r < 0) {
-          derr << __func__ << " got " << cpp_strerror(r) << dendl;
-          if (ioc->allow_eio && r == -EIO) {
-            ioc->set_return_value(r);
+          derr << __func__ << " got r=" << r << " (" << cpp_strerror(r) << ")"
+              << dendl;
+          if (ioc->allow_eio && is_expected_ioerr(r)) {
+            derr << __func__ << " translating the error to EIO for upper layer"
+                << dendl;
+            ioc->set_return_value(-EIO);
           } else {
             assert(0 == "got unexpected error from aio_t::get_return_value. "
                        "This may suggest HW issue. Please check your dmesg!");