From d445d5b8cc0a2090118941466592f712cf70a51e Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 9 Jun 2016 15:20:45 -0400 Subject: [PATCH] os/bluestore: clean up csum read error checks Fix warning message and return error code. Signed-off-by: Sage Weil --- src/os/bluestore/BlueStore.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 760b718dd27..7d45f547fdc 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -3338,7 +3338,10 @@ int BlueStore::_do_read( assert(r == 0); bl.claim_append(t); }); - _verify_csum(&bptr->blob, r_off, bl); + int r = _verify_csum(&bptr->blob, r_off, bl); + if (r < 0) { + return r; + } // prune and keep result ready_regions[reg.logical_offset].substr_of(bl, front, reg.length); @@ -3446,10 +3449,10 @@ int BlueStore::_verify_csum(const bluestore_blob_t* blob, uint64_t blob_xoffset, int r = blob->verify_csum(blob_xoffset, bl, &bad); if (r < 0) { if (r == -1) { - dout(20) << __func__ << "bad checksum at blob offset 0x" + dout(20) << __func__ << " bad checksum at blob offset 0x" << std::hex << bad << std::dec << dendl; } else { - derr << __func__ << "failed with exit code: " << cpp_strerror(r) << dendl; + derr << __func__ << " failed with exit code: " << cpp_strerror(r) << dendl; } return r; } else {