diff options
author | Hanna Reitz <hreitz@redhat.com> | 2022-11-07 16:13:21 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2022-11-10 14:58:43 +0100 |
commit | ace5a161ea1c09d8eaa8b2a717528457dc924e83 (patch) | |
tree | d8e9bcf2027e4af7e6643448cca9b6563c2a6944 /block/qed.c | |
parent | af5b6ebe5b887cb650434f9f7294af597a66314c (diff) |
block: Start/end drain on correct AioContext
bdrv_parent_drained_{begin,end}_single() are supposed to operate on the
parent, not on the child, so they should not attempt to get the context
to poll from the child but the parent instead. BDRV_POLL_WHILE(c->bs)
does get the context from the child, so we should replace it with
AIO_WAIT_WHILE() on the parent's context instead.
This problem becomes apparent when bdrv_replace_child_noperm() invokes
bdrv_parent_drained_end_single() after removing a child from a subgraph
that is in an I/O thread. By the time bdrv_parent_drained_end_single()
is called, child->bs is NULL, and so BDRV_POLL_WHILE(c->bs, ...) will
poll the main loop instead of the I/O thread; but anything that
bdrv_parent_drained_end_single_no_poll() may have scheduled is going to
want to run in the I/O thread, but because we poll the main loop, the
I/O thread is never unpaused, and nothing is run, resulting in a
deadlock.
Closes: https://gitlab.com/qemu-project/qemu/-/issues/1215
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20221107151321.211175-4-hreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/qed.c')
0 files changed, 0 insertions, 0 deletions