From: xie xingguo Date: Sun, 17 Apr 2016 09:35:19 +0000 (+0800) Subject: osd: fix be_deep_scrub() can't catch omap error X-Git-Tag: v11.0.0~716^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0690f16ff27f867caf18f5c8a9433756660fefc9;p=ceph.git 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 --- diff --git a/src/osd/ReplicatedBackend.cc b/src/osd/ReplicatedBackend.cc index 5c6d5e834bcd..d42442f2c947 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;