]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: make fsck can catch bad bnode key too
authorxie xingguo <xie.xingguo@zte.com.cn>
Fri, 24 Jun 2016 06:57:30 +0000 (14:57 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Fri, 24 Jun 2016 06:57:30 +0000 (14:57 +0800)
The case may be rare but the check shall do no harm.

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

index c58c9bef1bdf02036aceebb41fc942b53505c66f..6bec2f3c8beb37383039d481becac0f5fba051c0 100644 (file)
@@ -2966,8 +2966,13 @@ int BlueStore::fsck()
                   << std::hex << expecting_hash << std::dec << dendl;
          ++errors;
        }
-       get_key_bnode(it->key(), &expecting_shard, &expecting_pool,
+       int r = get_key_bnode(it->key(), &expecting_shard, &expecting_pool,
                      &expecting_hash);
+        if (r < 0) {
+          dout(30) << __func__ << "  bad bnode key "
+                   << pretty_binary_string(it->key()) << dendl;
+          ++errors;
+        }
        continue;
       }
       int r = get_key_object(it->key(), &oid);