]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore: propagate read-EIO to high level callers
authorxie xingguo <xie.xingguo@zte.com.cn>
Fri, 15 Sep 2017 02:30:04 +0000 (10:30 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Fri, 15 Sep 2017 02:58:42 +0000 (10:58 +0800)
E.g., we can let auto-repair to properly handle this
instead of crashing the whole osd.

Observe this once on one of our test cluster:

/clove/vm/clove/ceph/rpmbuild/BUILD/ceph-12.2.0/src/os/bluestore/BlueStore.cc: 6604: FAILED assert(r == 0)

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/BlueStore.cc

index 1bbba5ede3a9f513c7d1a8ac30e97571f7ed833a..b20e3a8494e36dbb6960d3cd0083afdaed56d579 100644 (file)
@@ -6517,7 +6517,14 @@ int BlueStore::_do_read(
             return r;
           return 0;
        });
+      if (r < 0) {
+        derr << __func__ << " bdev-read failed: " << cpp_strerror(r) << dendl;
+        if (r == -EIO) {
+          // propagate EIO to caller
+          return r;
+        }
         assert(r == 0);
+      }
     } else {
       // read the pieces
       for (auto& reg : p.second) {
@@ -6555,7 +6562,15 @@ int BlueStore::_do_read(
               return r;
             return 0;
          });
-       assert(r == 0);
+        if (r < 0) {
+          derr << __func__ << " bdev-read failed: " << cpp_strerror(r)
+               << dendl;
+          if (r == -EIO) {
+            // propagate EIO to caller
+            return r;
+          }
+          assert(r == 0);
+        }
        assert(reg.bl.length() == r_len);
       }
     }