From: xie xingguo Date: Wed, 6 Jul 2016 03:43:35 +0000 (+0800) Subject: os/bluestore: add sanity check for get_free() method X-Git-Tag: ses5-milestone5~437^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6147ea0f2935c1e50b40de9e810b3cf554078241;p=ceph.git os/bluestore: add sanity check for get_free() method Signed-off-by: xie xingguo --- diff --git a/src/os/bluestore/BitMapAllocator.cc b/src/os/bluestore/BitMapAllocator.cc index 04f5dc70025c..d42093e79b1f 100644 --- a/src/os/bluestore/BitMapAllocator.cc +++ b/src/os/bluestore/BitMapAllocator.cc @@ -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);