From: Jianpeng Ma Date: Mon, 30 Oct 2017 22:01:39 +0000 (+0800) Subject: os/bluestore: remove "q.empyt()" check in _is_all_kv_submitted. X-Git-Tag: v13.0.1~219^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=aedb6a19da257f10a90795857a2247781b89fe4e;p=ceph.git os/bluestore: remove "q.empyt()" check in _is_all_kv_submitted. Most call _is_all_kv_submitted under the situation: q.empty() is false. Signed-off-by: Jianpeng Ma --- diff --git a/src/os/bluestore/BlueStore.h b/src/os/bluestore/BlueStore.h index c1ee32f7d54..2fe22edd342 100644 --- a/src/os/bluestore/BlueStore.h +++ b/src/os/bluestore/BlueStore.h @@ -1722,10 +1722,8 @@ public: } bool _is_all_kv_submitted() { - // caller must hold qlock - if (q.empty()) { - return true; - } + // caller must hold qlock & q.empty() must not empty + assert(!q.empty()); TransContext *txc = &q.back(); if (txc->state >= TransContext::STATE_KV_SUBMITTED) { return true; @@ -1740,7 +1738,7 @@ public: // may become true outside qlock, and we need to make // sure those threads see waiters and signal qcond. ++kv_submitted_waiters; - if (_is_all_kv_submitted()) { + if (q.empty() || _is_all_kv_submitted()) { --kv_submitted_waiters; return; }