[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v2 06/17] job: Use AIO_WAIT_WHILE() in job_finis
From: |
Max Reitz |
Subject: |
Re: [Qemu-block] [PATCH v2 06/17] job: Use AIO_WAIT_WHILE() in job_finish_sync() |
Date: |
Thu, 13 Sep 2018 16:45:33 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 |
On 13.09.18 14:52, Kevin Wolf wrote:
> job_finish_sync() needs to release the AioContext lock of the job before
> calling aio_poll(). Otherwise, callbacks called by aio_poll() would
> possibly take the lock a second time and run into a deadlock with a
> nested AIO_WAIT_WHILE() call.
>
> Also, job_drain() without aio_poll() isn't necessarily enough to make
> progress on a job, it could depend on bottom halves to be executed.
>
> Combine both open-coded while loops into a single AIO_WAIT_WHILE() call
> that solves both of these problems.
>
> Signed-off-by: Kevin Wolf <address@hidden>
> Reviewed-by: Fam Zheng <address@hidden>
> ---
> job.c | 14 ++++++--------
> 1 file changed, 6 insertions(+), 8 deletions(-)
Reviewed-by: Max Reitz <address@hidden>
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-block] [Qemu-devel] [PATCH v2 01/17] job: Fix missing locking due to mismerge, (continued)
- [Qemu-block] [PATCH v2 04/17] test-bdrv-drain: Drain with block jobs in an I/O thread, Kevin Wolf, 2018/09/13
- [Qemu-block] [PATCH v2 05/17] test-blockjob: Acquire AioContext around job_cancel_sync(), Kevin Wolf, 2018/09/13
- [Qemu-block] [PATCH v2 06/17] job: Use AIO_WAIT_WHILE() in job_finish_sync(), Kevin Wolf, 2018/09/13
- [Qemu-block] [PATCH v2 08/17] block: Add missing locking in bdrv_co_drain_bh_cb(), Kevin Wolf, 2018/09/13
- [Qemu-block] [PATCH v2 09/17] block-backend: Add .drained_poll callback, Kevin Wolf, 2018/09/13
- [Qemu-block] [PATCH v2 07/17] test-bdrv-drain: Test AIO_WAIT_WHILE() in completion callback, Kevin Wolf, 2018/09/13
- [Qemu-block] [PATCH v2 10/17] block-backend: Fix potential double blk_delete(), Kevin Wolf, 2018/09/13