]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
os/bluestore: _txc_create inside of alloc_and_submit_lock
authorSage Weil <sage@newdream.net>
Tue, 19 Oct 2021 21:28:55 +0000 (16:28 -0500)
committerSage Weil <sage@newdream.net>
Fri, 29 Oct 2021 13:56:43 +0000 (09:56 -0400)
commitc1a67d9af5f387fb9590660bf42ec58d18f5a5f7
treed47982c7eff8eca75c013e816c293dce04c6c6c7
parent9e4c576aa60c1b42132ff8c9c4e91534a4202b02
os/bluestore: _txc_create inside of alloc_and_submit_lock

Create the transaction inside of the SMR lock.  Otherwise, we may get a
deadlock between the cleaner C and a normal write op W:

W                         C
_txc_create seq 1
                          lock alloc_and_submit
                          _txc_create seq 2
                          ...
                          unlock alloc_and_submit
lock alloc_and_submit
...
block on flush
                          _txc_finish_io, but blocked by seq 1
<deadlock>

The root issue here is the txc's are misordered with respect to the
alloc_and_submit lock.

Fix by moving the _txc_create inside the lock!

Signed-off-by: Sage Weil <sage@newdream.net>
src/os/bluestore/BlueStore.cc