|
From: | Paolo Bonzini |
Subject: | Re: [PATCH 1/6] block/io.c: fix bdrv_child_cb_drained_begin invocations from a coroutine |
Date: | Mon, 14 Feb 2022 12:57:30 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 |
On 2/14/22 11:27, Emanuele Giuseppe Esposito wrote:
Anyways, I think that in addition to the fix in this patch, we should also fix bdrv_parent_drained_begin_single(poll=true) in bdrv_replace_child_noperm, with something similar to what is done in bdrv_co_yield_to_drain? ie if we are in coroutine, schedule a BH that runs the same logic but in the main loop, but then somehow wait that it finishes before continuing? Alternatively, we would forbid polling in coroutines at all. And the only place I can see that is using the drain in coroutine is mirror (see below).
I think you should first of all see what breaks if you forbid bdrv_replace_child_noperm() from coroutine context.
Drain in coroutines does not poll, it gets out of the coroutine through a bottom half before polling. So if bdrv_replace_child_noperm() doesn't require it, polling in coroutines can still be forbidden.
This patch is correct nevertheless. Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |