|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v2 RESEND] xen: Fix SEGV on domain disconnect
On 20/04/2023 12:02, mark.syms@xxxxxxxxxx wrote: From: Mark Syms <mark.syms@xxxxxxxxxx> Ensure the PV ring is drained on disconnect. Also ensure all pending AIO is complete, otherwise AIO tries to complete into a mapping of the ring which has been torn down. Signed-off-by: Mark Syms <mark.syms@xxxxxxxxxx> --- CC: Stefano Stabellini <sstabellini@xxxxxxxxxx> CC: Anthony Perard <anthony.perard@xxxxxxxxxx> CC: Paul Durrant <paul@xxxxxxx> CC: xen-devel@xxxxxxxxxxxxxxxxxxxx v2: * Ensure all inflight requests are completed before teardown * RESEND to fix formatting --- hw/block/dataplane/xen-block.c | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/hw/block/dataplane/xen-block.c b/hw/block/dataplane/xen-block.c index 734da42ea7..d9da4090bf 100644 --- a/hw/block/dataplane/xen-block.c +++ b/hw/block/dataplane/xen-block.c @@ -523,6 +523,10 @@ static bool xen_block_handle_requests(XenBlockDataPlane *dataplane)dataplane->more_work = 0; + if (dataplane->sring == 0) {+ return done_something; + } + I think you could just return false here... Nothing is ever going to be done if there's no ring :-)
I don't think we want to be taking new requests, do we? I think this could possibly be simplified by doing the drain after the call to blk_set_aio_context(), as long as we set dataplane->ctx to qemu_get_aio_context(). Alos, as long as more_work is not set then it should still be safe to cancel the bh before the drain AFAICT. Paul
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |