From 0690f16ff27f867caf18f5c8a9433756660fefc9 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Sun, 17 Apr 2016 17:35:19 +0800 Subject: [PATCH] osd: fix be_deep_scrub() can't catch omap error be_deep_scrub() will scan the omap of the specified object also. However, this can not work as expected currently because iter->status() does not return -EIO on error, it returns -1 instead. Signed-off-by: xie xingguo --- src/osd/ReplicatedBackend.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/osd/ReplicatedBackend.cc b/src/osd/ReplicatedBackend.cc index 5c6d5e834bc..d42442f2c94 100644 --- a/src/osd/ReplicatedBackend.cc +++ b/src/osd/ReplicatedBackend.cc @@ -805,7 +805,8 @@ void ReplicatedBackend::be_deep_scrub( poid, ghobject_t::NO_GEN, get_parent()->whoami_shard().shard)); assert(iter); uint64_t keys_scanned = 0; - for (iter->seek_to_first(); iter->valid() ; iter->next(false)) { + for (iter->seek_to_first(); iter->status() == 0 && iter->valid(); + iter->next(false)) { if (cct->_conf->osd_scan_list_ping_tp_interval && (keys_scanned % cct->_conf->osd_scan_list_ping_tp_interval == 0)) { handle.reset_tp_timeout(); @@ -821,12 +822,14 @@ void ReplicatedBackend::be_deep_scrub( oh << bl; bl.clear(); } - if (iter->status() == -EIO) { - dout(25) << __func__ << " " << poid << " got " - << r << " on omap scan, read_error" << dendl; + + if (iter->status() < 0) { + dout(25) << __func__ << " " << poid + << " on omap scan, db status error" << dendl; o.read_error = true; return; } + //Store final calculated CRC32 of omap header & key/values o.omap_digest = oh.digest(); o.omap_digest_present = true; -- 2.47.3