From: xie xingguo Date: Fri, 24 Jun 2016 06:57:30 +0000 (+0800) Subject: os/bluestore: make fsck can catch bad bnode key too X-Git-Tag: v11.0.0~50^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=815f90348b0c6bb1be7f98f8e32a8d9a8436f180;p=ceph.git os/bluestore: make fsck can catch bad bnode key too The case may be rare but the check shall do no harm. Signed-off-by: xie xingguo --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index c58c9bef1bdf..6bec2f3c8beb 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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);