Skip to content

Commit 92003cb

Browse files
committed
Fix deadlock with coalesce and vdi activation
If the VDI is being coalesced, the VDI activation would want to interrupt it. But the LVMSR coalesce needs the lvchange-p lock of the SR. Moved the check for chain coalesce before taking the lock. Signed-off-by: Damien Thenot <damien.thenot@vates.tech>
1 parent 0d013a5 commit 92003cb

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

drivers/blktap2.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1775,6 +1775,8 @@ def _activate_locked(self, sr_uuid, vdi_uuid, options):
17751775

17761776
vdi_type = self.target.get_vdi_type()
17771777

1778+
if not self._check_journal_coalesce_chain(sr_uuid, vdi_uuid):
1779+
return False
17781780

17791781
# Take lvchange-p Lock before running
17801782
# tap-ctl open
@@ -1787,11 +1789,6 @@ def _activate_locked(self, sr_uuid, vdi_uuid, options):
17871789
lock = Lock("lvchange-p", NS_PREFIX_LVM + sr_uuid)
17881790
lock.acquire()
17891791

1790-
if not self._check_journal_coalesce_chain(sr_uuid, vdi_uuid):
1791-
return False
1792-
# we could return false from here if we need to retry after relink
1793-
# #TODO: handling error here
1794-
17951792
# When we attach a static VDI for HA, we cannot communicate with
17961793
# xapi, because has not started yet. These VDIs are raw.
17971794
if VdiType.isCowImage(vdi_type):

0 commit comments

Comments
 (0)