]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix be_deep_scrub() can't catch omap error 8632/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Sun, 17 Apr 2016 09:35:19 +0000 (17:35 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Mon, 18 Apr 2016 12:48:33 +0000 (20:48 +0800)
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 <xie.xingguo@zte.com.cn>
src/osd/ReplicatedBackend.cc

index 5c6d5e834bcd2f0736c53ad87ad999b8b5124614..d42442f2c947ae68f9cae0cf30e826e3b10b05c7 100644 (file)
@@ -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;