From: xie xingguo Date: Sat, 4 Jun 2016 03:04:18 +0000 (+0800) Subject: bluestore/BitAllocator: fix race condition X-Git-Tag: v11.0.0~285^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8940433f67cc38d87b3a49745ad3086b879ac860;p=ceph.git bluestore/BitAllocator: fix race condition Signed-off-by: xie xingguo --- diff --git a/src/os/bluestore/BitAllocator.cc b/src/os/bluestore/BitAllocator.cc index 6b819b37cbb8..63c3de86c59a 100644 --- a/src/os/bluestore/BitAllocator.cc +++ b/src/os/bluestore/BitAllocator.cc @@ -826,6 +826,7 @@ void BitMapAreaIN::unreserve(int64_t needed, int64_t allocated) } int64_t BitMapAreaIN::get_reserved_blocks() { + std::lock_guard l(m_blocks_lock); return m_reserved_blocks; }