From: xie xingguo Date: Sat, 3 Sep 2016 03:38:00 +0000 (+0800) Subject: os/bluestore: check iterator before using during fsck X-Git-Tag: v11.0.1~328^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=578f90c3298ff69a5bb87a768791e362a566fae3;p=ceph.git os/bluestore: check iterator before using during fsck Also drop redundant checking. Signed-off-by: xie xingguo --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index fd4b343d741f..ecb8a23f750d 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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();