05.05.2021 19:18, Kevin Wolf wrote:
And then, bdrv_reopen_multiple() is called with no aio context
acquired, and no drained section.. And it shoud be refactored to
properly operate with acquiring and realeasing the contexts and
drained sections when needed...
The drained section shouldn't be a problem, we can keep this. In fact,
we need this, it is a documented requirement of bdrv_reopen_multiple().
We just need to drop the AioContext lock after drained_begin.
bdrv_reopen_multiple() should really document its requirements regarding
AioContext locks. It probably doesn't really care, but requires that
it be called from the main thread.
(note preexisting problem of reopen, that during reopen the whole tree
may be moved to another aio context, but we continue operations with
acquired old aio context which is wrong).
Do we even acquire the old AioContext?
I think, I mean aio_context_acquire(ctx); in current qmp_x_blockdev_reopen()..
And I remember, that you said about that problem. Still, may be I misunderstood
(or misremember). Doesn't worth digging, I'd prefer just review v5 with a fresh
eye when it comes.
--
Best regards,
Vladimir