From: xie xingguo Date: Sat, 10 Sep 2016 02:05:32 +0000 (+0800) Subject: os/bluestore: fix race condition X-Git-Tag: v11.0.1~261^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1ab12fa8f5f23da298a9486b38dc078247d94c67;p=ceph.git os/bluestore: fix race condition The empty() method also needs to be called under the protection of lock. Signed-off-by: xie xingguo --- diff --git a/src/os/bluestore/BlueStore.h b/src/os/bluestore/BlueStore.h index 16dad8409f88..7ef031bea4d4 100644 --- a/src/os/bluestore/BlueStore.h +++ b/src/os/bluestore/BlueStore.h @@ -378,6 +378,7 @@ public: } bool empty() { + std::lock_guard l(lock); return uset.empty(); } };