[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH 6/9] blkdebug: Implement .cancel_async
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [RFC PATCH 6/9] blkdebug: Implement .cancel_async |
Date: |
Thu, 21 Aug 2014 17:52:45 +0100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Thu, Aug 21, 2014 at 07:56:53PM +0800, Fam Zheng wrote:
> @@ -446,12 +439,25 @@ static void error_callback_bh(void *opaque)
> qemu_aio_release(acb);
> }
>
> +static void blkdebug_aio_cancel_async(BlockDriverAIOCB *blockacb)
> +{
> + BlkdebugAIOCB *acb = container_of(blockacb, BlkdebugAIOCB, common);
> + blockacb->cb(blockacb->opaque, -ECANCELED);
> + qemu_aio_release(acb);
> +}
> +
> static void blkdebug_aio_cancel(BlockDriverAIOCB *blockacb)
> {
> BlkdebugAIOCB *acb = container_of(blockacb, BlkdebugAIOCB, common);
> qemu_aio_release(acb);
> }
Both blkdebug_aio_cancel() and blkdebug_aio_cancel_async() look
incorrect. It is not safe to release acb because the
error_callback_bh() BH may still be scheduled.
I guess we don't hit this problem because the error injection happens
within the same event loop iteration. In practice no one ever calls
blkdebug_aio_cancel()?
Stefan
pgpUntleZhv_d.pgp
Description: PGP signature
- [Qemu-devel] [RFC PATCH 3/9] iscsi: Implement .cancel_async in acb info, (continued)
- [Qemu-devel] [RFC PATCH 3/9] iscsi: Implement .cancel_async in acb info, Fam Zheng, 2014/08/21
- [Qemu-devel] [RFC PATCH 4/9] linux-aio: Implement .cancel_async, Fam Zheng, 2014/08/21
- [Qemu-devel] [RFC PATCH 5/9] thread-pool: Implement .cancel_async, Fam Zheng, 2014/08/21
- [Qemu-devel] [RFC PATCH 7/9] dma: Implement .cancel_async, Fam Zheng, 2014/08/21
- [Qemu-devel] [RFC PATCH 8/9] block: Implement stub bdrv_em_co_aiocb_info.cancel_async, Fam Zheng, 2014/08/21
- [Qemu-devel] [RFC PATCH 6/9] blkdebug: Implement .cancel_async, Fam Zheng, 2014/08/21
- Re: [Qemu-devel] [RFC PATCH 6/9] blkdebug: Implement .cancel_async,
Stefan Hajnoczi <=
- [Qemu-devel] [RFC PATCH 9/9] scsi: Cancel request asynchronously, Fam Zheng, 2014/08/21