]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: remove "q.empyt()" check in _is_all_kv_submitted. 18622/head
authorJianpeng Ma <jianpeng.ma@intel.com>
Mon, 30 Oct 2017 22:01:39 +0000 (06:01 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Mon, 30 Oct 2017 22:01:39 +0000 (06:01 +0800)
Most call _is_all_kv_submitted under the situation: q.empty() is false.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
src/os/bluestore/BlueStore.h

index c1ee32f7d54a37b369d432a2b0753bc1cacce8c0..2fe22edd342bfef50ef6e227ba7aa88167078bf0 100644 (file)
@@ -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;
        }