From: xie xingguo Date: Sat, 23 Jan 2016 02:50:04 +0000 (+0800) Subject: BlueFS: fix race condition X-Git-Tag: v10.0.4~57^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=881ac7addac68add3d048f5fca4b3a72535e6c46;p=ceph.git BlueFS: fix race condition Fixes: #14480 Signed-off-by: xie xingguo --- diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc index 350ea8d63e8..759d2c8918b 100644 --- a/src/os/bluestore/BlueFS.cc +++ b/src/os/bluestore/BlueFS.cc @@ -83,6 +83,7 @@ void BlueFS::add_block_extent(unsigned id, uint64_t offset, uint64_t length) int BlueFS::reclaim_blocks(unsigned id, uint64_t want, uint64_t *offset, uint32_t *length) { + std::lock_guard l(lock); dout(1) << __func__ << " bdev " << id << " want " << want << dendl; assert(id < alloc.size()); int r = alloc[id]->reserve(want);