Re: [PATCH] rbd block driver fix race between aio completition and aio cancel

2012-11-29 Thread Stefan Hajnoczi
On Thu, Nov 22, 2012 at 11:00:19AM +0100, Stefan Priebe wrote: @@ -406,10 +401,11 @@ static void qemu_rbd_complete_aio(RADOSCB *rcb) acb-ret = r; } } +acb-status = 0; + I suggest doing this in the BH. The qemu_aio_wait() loop in qemu_rbd_aio_cancel() needs to

Re: [PATCH] rbd block driver fix race between aio completition and aio cancel

2012-11-29 Thread Stefan Priebe - Profihost AG
Hi, i hope i've done everything correctly. I've send a new v4 patch. Am 29.11.2012 14:58, schrieb Stefan Hajnoczi: On Thu, Nov 22, 2012 at 11:00:19AM +0100, Stefan Priebe wrote: @@ -406,10 +401,11 @@ static void qemu_rbd_complete_aio(RADOSCB *rcb) acb-ret = r; }

Re: [PATCH] rbd block driver fix race between aio completition and aio cancel

2012-11-29 Thread Paolo Bonzini
@@ -574,6 +570,12 @@ static void qemu_rbd_aio_cancel(BlockDriverAIOCB *blockacb) { RBDAIOCB *acb = (RBDAIOCB *) blockacb; acb-cancelled = 1; + +while (acb-status == -EINPROGRESS) { +qemu_aio_wait(); +} + There should be a

Re: [PATCH] rbd block driver fix race between aio completition and aio cancel

2012-11-27 Thread Josh Durgin
On 11/22/2012 02:00 AM, Stefan Priebe wrote: This one fixes a race which qemu had also in iscsi block driver between cancellation and io completition. qemu_rbd_aio_cancel was not synchronously waiting for the end of the command. To archieve this it introduces a new status flag which uses

[PATCH] rbd block driver fix race between aio completition and aio cancel

2012-11-22 Thread Stefan Priebe
This one fixes a race which qemu had also in iscsi block driver between cancellation and io completition. qemu_rbd_aio_cancel was not synchronously waiting for the end of the command. To archieve this it introduces a new status flag which uses -EINPROGRESS. Signed-off-by: Stefan Priebe

[PATCH] rbd block driver fix race between aio completition and aio cancel

2012-11-19 Thread Stefan Priebe
From: Stefan Priebe s.pri...@profhost.ag This one fixes a race qemu also had in iscsi block driver between cancellation and io completition. qemu_rbd_aio_cancel was not synchronously waiting for the end of the command. It also removes the useless cancelled flag and introduces instead a status