]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: fix decoding hash of bnode 10773/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Thu, 18 Aug 2016 10:12:23 +0000 (18:12 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Thu, 18 Aug 2016 22:30:16 +0000 (06:30 +0800)
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 <xie.xingguo@zte.com.cn>
src/os/bluestore/BlueStore.cc

index dc7e822b4d518f05768a0dd56a6b4d805e3577e3..2f1d9afe2b8b9e93d8719fd6b4ec7472460fe48e 100644 (file)
@@ -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;
 }