From 815f90348b0c6bb1be7f98f8e32a8d9a8436f180 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Fri, 24 Jun 2016 14:57:30 +0800 Subject: [PATCH] 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 --- src/os/bluestore/BlueStore.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index c58c9bef1bdf0..6bec2f3c8beb3 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); -- 2.39.5