From 3325ab02b7f55eb0a00569387b960899f01490a0 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Thu, 14 Jul 2016 16:49:16 +0800 Subject: [PATCH] os/bluestore: remove expecting_objects checking for stary bnode/onode It actually never works for now and there is no easy way to do such check. Signed-off-by: xie xingguo --- src/os/bluestore/BlueStore.cc | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 3e834e33d4ee6..74df5b9234925 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -3096,18 +3096,12 @@ int BlueStore::fsck() it = db->get_iterator(PREFIX_OBJ); if (it) { CollectionRef c; - bool expecting_objects = false; shard_id_t expecting_shard; int64_t expecting_pool; uint32_t expecting_hash; for (it->lower_bound(string()); it->valid(); it->next()) { ghobject_t oid; if (is_bnode_key(it->key())) { - if (expecting_objects) { - dout(30) << __func__ << " had bnode but no objects for 0x" - << std::hex << expecting_hash << std::dec << dendl; - ++errors; - } int r = get_key_bnode(it->key(), &expecting_shard, &expecting_pool, &expecting_hash); if (r < 0) { @@ -3117,6 +3111,7 @@ int BlueStore::fsck() } continue; } + int r = get_key_object(it->key(), &oid); if (r < 0) { dout(30) << __func__ << " bad object key " @@ -3124,14 +3119,7 @@ int BlueStore::fsck() ++errors; continue; } - if (expecting_objects) { - if (oid.hobj.get_bitwise_key_u32() != expecting_hash) { - dout(30) << __func__ << " had bnode but no objects for 0x" - << std::hex << expecting_hash << std::dec << dendl; - ++errors; - } - expecting_objects = false; - } + if (!c || !c->contains(oid)) { c = NULL; for (ceph::unordered_map::iterator p = @@ -3151,12 +3139,6 @@ int BlueStore::fsck() } } } - if (expecting_objects) { - dout(30) << __func__ << " had bnode but no objects for 0x" - << std::hex << expecting_hash << std::dec << dendl; - ++errors; - expecting_objects = false; - } } dout(1) << __func__ << " checking for stray omap data" << dendl; -- 2.39.5