[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 05/22] block: Convert bdrv_em_aiocb_info.canc
From: |
Fam Zheng |
Subject: |
Re: [Qemu-devel] [PATCH v5 05/22] block: Convert bdrv_em_aiocb_info.cancel to .cancel_async |
Date: |
Wed, 10 Sep 2014 17:36:04 +0800 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Wed, 09/10 10:20, Paolo Bonzini wrote:
> Il 10/09/2014 07:59, Fam Zheng ha scritto:
> > @@ -4679,6 +4679,9 @@ static void bdrv_aio_cancel_em(BlockDriverAIOCB
> > *blockacb)
> > {
> > BlockDriverAIOCBSync *acb =
> > container_of(blockacb, BlockDriverAIOCBSync, common);
> > +
> > + acb->ret = -ECANCELED;
> > + acb->common.cb(acb->common.opaque, acb->ret);
> > qemu_bh_delete(acb->bh);
> > acb->bh = NULL;
> > qemu_aio_release(acb);
>
> This could call the callback before I/O is finished. I/O can then
> complete and write to disk stuff that was not meant to be written.
I think the request is already completed when bdrv_aio_rw_vector returns this
blockacb. I shouldn't override the return code anyway, but perhaps a nop
bdrv_aio_cancel_em is better.
>
> I think there is a pre-existing bug, which should be fixed with a "bool
> *done" member similar to BlockDriverAIOCBCoroutine's. But for the sake
> of conversion to async cancellation, you can just empty bdrv_aio_cancel_em.
>
BTW, why is it "bool *done" instead of just "bool done"?
Fam
- [Qemu-devel] [PATCH v5 00/22] block: Asynchronous request cancellation, Fam Zheng, 2014/09/10
- [Qemu-devel] [PATCH v5 01/22] ide/ahci: Check for -ECANCELED in aio callbacks, Fam Zheng, 2014/09/10
- [Qemu-devel] [PATCH v5 02/22] block: Add refcnt in BlockDriverAIOCB, Fam Zheng, 2014/09/10
- [Qemu-devel] [PATCH v5 03/22] block: Add bdrv_aio_cancel_async, Fam Zheng, 2014/09/10
- [Qemu-devel] [PATCH v5 04/22] block: Drop bdrv_em_co_aiocb_info.cancel, Fam Zheng, 2014/09/10
- [Qemu-devel] [PATCH v5 05/22] block: Convert bdrv_em_aiocb_info.cancel to .cancel_async, Fam Zheng, 2014/09/10
- [Qemu-devel] [PATCH v5 06/22] thread-pool: Convert thread_pool_aiocb_info.cancel to cancel_async, Fam Zheng, 2014/09/10
- [Qemu-devel] [PATCH v5 07/22] linux-aio: Convert laio_aiocb_info.cancel to .cancel_async, Fam Zheng, 2014/09/10
- [Qemu-devel] [PATCH v5 08/22] dma: Convert dma_aiocb_info.cancel to .cancel_async, Fam Zheng, 2014/09/10
- [Qemu-devel] [PATCH v5 09/22] iscsi: Convert iscsi_aiocb_info.cancel to .cancel_async, Fam Zheng, 2014/09/10
- [Qemu-devel] [PATCH v5 10/22] archipelago: Drop archipelago_aiocb_info.cancel, Fam Zheng, 2014/09/10
- [Qemu-devel] [PATCH v5 11/22] blkdebug: Drop blkdebug_aiocb_info.cancel, Fam Zheng, 2014/09/10
- [Qemu-devel] [PATCH v5 13/22] curl: Drop curl_aiocb_info.cancel, Fam Zheng, 2014/09/10
- [Qemu-devel] [PATCH v5 14/22] qed: Drop qed_aiocb_info.cancel, Fam Zheng, 2014/09/10
- [Qemu-devel] [PATCH v5 15/22] quorum: fix quorum_aio_cancel(), Fam Zheng, 2014/09/10