From: Sage Weil Date: Mon, 28 Nov 2016 19:23:36 +0000 (-0500) Subject: os/bluestore: be pedantic about kv_stop locking X-Git-Tag: v11.1.0~120^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=614e955d58348d55d3271a07507a80aee5747154;p=ceph.git os/bluestore: be pedantic about kv_stop locking Makes coverity happy. CID 1395346 (#1 of 1): Data race condition (MISSING_LOCK) 1. missing_lock: Accessing this->kv_stop without holding lock BlueStore.kv_lock. Elsewhere, "BlueStore.kv_stop" is accessed with BlueStore.kv_lock held 1 out of 2 times (1 of these accesses strongly imply that it is necessary). Signed-off-by: Sage Weil --- diff --git a/src/os/bluestore/BlueStore.h b/src/os/bluestore/BlueStore.h index 2676afe6f70d..07dc17ae9c19 100644 --- a/src/os/bluestore/BlueStore.h +++ b/src/os/bluestore/BlueStore.h @@ -1677,7 +1677,10 @@ private: kv_cond.notify_all(); } kv_sync_thread.join(); - kv_stop = false; + { + std::lock_guard l(kv_lock); + kv_stop = false; + } } bluestore_wal_op_t *_get_wal_op(TransContext *txc, OnodeRef o);