From: xie xingguo Date: Thu, 18 Aug 2016 10:12:23 +0000 (+0800) Subject: os/bluestore: fix decoding hash of bnode X-Git-Tag: v11.0.1~426^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=434b18a61e5f13c8982ea9898ef4782bf4bd246e;p=ceph-ci.git os/bluestore: fix decoding hash of bnode We encode reversed bits of hash and then write it onto disk, therefore we shall decode and then reserse to get it back. Signed-off-by: xie xingguo --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index dc7e822b4d5..2f1d9afe2b8 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -276,7 +276,9 @@ static int get_key_bnode(const string& key, shard_id_t *shard, p = _key_decode_shard(p, shard); p = _key_decode_u64(p, (uint64_t*)pool); *pool -= 0x8000000000000000ull; - p = _key_decode_u32(p, hash); + uint32_t hash_reverse_bits; + p = _key_decode_u32(p, &hash_reverse_bits); + *hash = hobject_t::_reverse_bits(hash_reverse_bits); return 0; }