On 18/09/2018 13:34, Kevin Wolf wrote: >> But then basically the main issue is mirror.c's call to >> bdrv_drained_begin/end. There are no other calls to >> bdrv_drained_begin/end inside coroutines IIRC. > > Coroutine or not doesn't matter. What matters is that you drain inside > some (high-level) operation that already needs to be completed itself > for drain to return.
Indeed. However, are there any calls to bdrv_drained_begin/end that are inside inc_in_flight/dec_in_flight, and are not inside coroutines? (Sorry if I don't see the high-level issue, I'm more familiar with the low-level functioning...). It seems to me that if we fixed the mirror bdrv_(co_)drained_begin case, then it would be good enough. Paolo > This is the case for any block job completions that > make changes to the graph (which means everything except backup).