]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: fix race condition
authorxie xingguo <xie.xingguo@zte.com.cn>
Sat, 10 Sep 2016 02:05:32 +0000 (10:05 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Sat, 10 Sep 2016 02:05:32 +0000 (10:05 +0800)
The empty() method also needs to be called under the protection of lock.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/BlueStore.h

index 16dad8409f88246476476f73ba94fc95585826d0..7ef031bea4d42244c71b46fa0c0fa9f7bc7d445f 100644 (file)
@@ -378,6 +378,7 @@ public:
     }
 
     bool empty() {
+      std::lock_guard<std::mutex> l(lock);
       return uset.empty();
     }
   };