From: xie xingguo Date: Fri, 15 Sep 2017 02:30:04 +0000 (+0800) Subject: os/bluestore: propagate read-EIO to high level callers X-Git-Tag: v13.0.1~831^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a51d9e979fbbe49917712889efb102806479fad2;p=ceph-ci.git os/bluestore: propagate read-EIO to high level callers 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 --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 1bbba5ede3a..b20e3a8494e 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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); } }