]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: check iterator before using during fsck 10969/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Sat, 3 Sep 2016 03:38:00 +0000 (11:38 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Sat, 3 Sep 2016 08:14:30 +0000 (16:14 +0800)
Also drop redundant checking.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/BlueStore.cc

index fd4b343d741f43147ae7db5a1550b95c35610bbb..ecb8a23f750da089d5f2b68e43f7a97e1e55b071 100644 (file)
@@ -3268,7 +3268,6 @@ int BlueStore::fsck()
              dout(30) << __func__
                       << "  got " << pretty_binary_string(it->key())
                       << " -> " << user_key << dendl;
-             assert(it->key() < tail);
            }
            it->next();
          }
@@ -3360,8 +3359,8 @@ int BlueStore::fsck()
   }
 
   dout(1) << __func__ << " checking wal events" << dendl;
-  {
-    it = db->get_iterator(PREFIX_WAL);
+  it = db->get_iterator(PREFIX_WAL);
+  if (it) {
     for (it->lower_bound(string()); it->valid(); it->next()) {
       bufferlist bl = it->value();
       bufferlist::iterator p = bl.begin();
@@ -3419,7 +3418,6 @@ int BlueStore::fsck()
             << "~" << length << std::dec
             << " intersects allocated blocks" << dendl;
        ++errors;
-       continue;
       }
     }
     size_t count = used_blocks.count();