Skip to content

Commit

Permalink
os/bluestore: remove expecting_objects checking for stary bnode/onode
Browse files Browse the repository at this point in the history
It actually never works for now and there is no easy way to do such check.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
  • Loading branch information
xiexingguo committed Jul 14, 2016
1 parent 8e7f6ff commit f5b963a
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions src/os/bluestore/BlueStore.cc
Expand Up @@ -3102,18 +3102,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) {
Expand All @@ -3123,21 +3117,15 @@ int BlueStore::fsck()
}
continue;
}

int r = get_key_object(it->key(), &oid);
if (r < 0) {
dout(30) << __func__ << " bad object key "
<< pretty_binary_string(it->key()) << dendl;
++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<coll_t, CollectionRef>::iterator p =
Expand All @@ -3157,12 +3145,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;
Expand Down

0 comments on commit f5b963a

Please sign in to comment.