Skip to content

Commit 10187da

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 78cead5 commit 10187da

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
@@ -1772,6 +1772,8 @@ def _activate_locked(self, sr_uuid, vdi_uuid, options):
17721772

17731773
vdi_type = self.target.get_vdi_type()
17741774

1775+
if not self._check_journal_coalesce_chain(sr_uuid, vdi_uuid):
1776+
return False
17751777

17761778
# Take lvchange-p Lock before running
17771779
# tap-ctl open
@@ -1784,11 +1786,6 @@ def _activate_locked(self, sr_uuid, vdi_uuid, options):
17841786
lock = Lock("lvchange-p", NS_PREFIX_LVM + sr_uuid)
17851787
lock.acquire()
17861788

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

0 commit comments

Comments
 (0)