]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
bluestore/BitAllocator: fix race condition
authorxie xingguo <xie.xingguo@zte.com.cn>
Sat, 4 Jun 2016 03:04:18 +0000 (11:04 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Sat, 4 Jun 2016 03:49:39 +0000 (11:49 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/BitAllocator.cc

index 6b819b37cbb8e053452c3afa2f022c79b0ceae38..63c3de86c59aa09f458b515ee2376e026262daef 100644 (file)
@@ -826,6 +826,7 @@ void BitMapAreaIN::unreserve(int64_t needed, int64_t allocated)
 }
 int64_t BitMapAreaIN::get_reserved_blocks()
 {
+  std::lock_guard<std::mutex> l(m_blocks_lock); 
   return m_reserved_blocks;
 }