]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: add sanity check for get_free() method
authorxie xingguo <xie.xingguo@zte.com.cn>
Wed, 6 Jul 2016 03:43:35 +0000 (11:43 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Sun, 10 Jul 2016 13:25:49 +0000 (21:25 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/BitMapAllocator.cc

index 04f5dc70025c05529d302bfda5bfc7ef0f36edc8..d42093e79b1ff7099dfb6189fb4bb04dca740949 100644 (file)
@@ -152,6 +152,7 @@ int BitMapAllocator::release(
 
 uint64_t BitMapAllocator::get_free()
 {
+  assert(m_bit_alloc->size() >= m_bit_alloc->get_used_blocks());
   return ((
     m_bit_alloc->size() - m_bit_alloc->get_used_blocks()) *
     m_block_size);