]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: remove expecting_objects checking for stary bnode/onode
authorxie xingguo <xie.xingguo@zte.com.cn>
Thu, 14 Jul 2016 08:49:16 +0000 (16:49 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Thu, 14 Jul 2016 11:15:57 +0000 (19:15 +0800)
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>
src/os/bluestore/BlueStore.cc

index 3e834e33d4ee6cdbc8440b6a741a748b796f33e8..74df5b9234925f4e481e6aed955c4217c18d7103 100644 (file)
@@ -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<coll_t, CollectionRef>::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;