]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: be more protective in _deferred_queue 38992/head
authorIgor Fedotov <ifedotov@suse.com>
Wed, 20 Jan 2021 19:57:15 +0000 (22:57 +0300)
committerIgor Fedotov <ifedotov@suse.com>
Wed, 20 Jan 2021 19:57:15 +0000 (22:57 +0300)
Signed-off-by: Igor Fedotov <ifedotov@suse.com>
src/os/bluestore/BlueStore.cc

index 34afd92c390e1558b304b8592c2ed968ac2611ed..0ef42cf0e34664187e2b434113a1173102adf25e 100644 (file)
@@ -12268,13 +12268,10 @@ void BlueStore::_deferred_queue(TransContext *txc)
   dout(20) << __func__ << " txc " << txc << " osr " << txc->osr << dendl;
 
   DeferredBatch *tmp;
-  bool need_lock_again = false;
   txc->osr->deferred_lock.lock();
   {
     if (!txc->osr->deferred_pending) {
       tmp = new DeferredBatch(cct, txc->osr.get());
-      txc->osr->deferred_lock.unlock();
-      need_lock_again = true;
     } else {
       tmp  = txc->osr->deferred_pending;
     }
@@ -12292,9 +12289,6 @@ void BlueStore::_deferred_queue(TransContext *txc)
   }
 
   {
-    if (need_lock_again) {
-      txc->osr->deferred_lock.lock();
-    }
     ++deferred_queue_size;
     txc->osr->deferred_pending = tmp;
     // condition "tmp->txcs.size() == 1" mean deferred_pending was originally empty.