From 6147ea0f2935c1e50b40de9e810b3cf554078241 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Wed, 6 Jul 2016 11:43:35 +0800 Subject: [PATCH] os/bluestore: add sanity check for get_free() method Signed-off-by: xie xingguo --- src/os/bluestore/BitMapAllocator.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/os/bluestore/BitMapAllocator.cc b/src/os/bluestore/BitMapAllocator.cc index 04f5dc70025c0..d42093e79b1ff 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); -- 2.39.5