Skip to content

block: temporarily hold the new AioContext of bs_top in bdrv_append()

Stefano Garzarella requested to merge sgarzarella/qemu-kvm-c-9-s:bz2168209 into c9s

Merge Request Required Information

Summary of Changes

bdrv_append() is called with bs_top AioContext held, but
bdrv_attach_child_noperm() could change the AioContext of bs_top.

bdrv_replace_node_noperm() calls bdrv_drained_begin() starting from
commit 2398747128 ("block: Don't poll in bdrv_replace_child_noperm()").
bdrv_drained_begin() can call BDRV_POLL_WHILE that assumes the new lock
is taken, so let's temporarily hold the new AioContext to prevent QEMU
from failing in BDRV_POLL_WHILE when it tries to release the wrong
AioContext.

Approved Bugzilla Ticket

All submissions to CentOS Stream must reference an approved ticket in Red Hat Bugzilla. Please follow the CentOS Stream contribution documentation for how to file this ticket and have it approved.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2168209

Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=50877850

Signed-off-by: Stefano Garzarella sgarzare@redhat.com

Merge request reports