[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v2] block: make BDRV_POLL_WHILE() re-entrancy sa
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-block] [PATCH v2] block: make BDRV_POLL_WHILE() re-entrancy safe |
Date: |
Mon, 12 Mar 2018 11:07:55 +0000 |
User-agent: |
Mutt/1.9.2 (2017-12-15) |
On Wed, Mar 07, 2018 at 12:46:19PM +0000, Stefan Hajnoczi wrote:
> Nested BDRV_POLL_WHILE() calls can occur. Currently
> assert(!wait_->wakeup) fails in AIO_WAIT_WHILE() when this happens.
>
> This patch converts the bool wait_->need_kick flag to an unsigned
> wait_->num_waiters counter.
>
> Nesting works correctly because outer AIO_WAIT_WHILE() callers evaluate
> the condition again after the inner caller completes (invoking the inner
> caller counts as aio_poll() progress).
>
> Reported-by: "fuweiwei (C)" <address@hidden>
> Cc: Paolo Bonzini <address@hidden>
> Signed-off-by: Stefan Hajnoczi <address@hidden>
> ---
> v2:
> * Rebase onto qemu.git/master now that AIO_WAIT_WHILE() has landed
> [Kevin]
>
> include/block/aio-wait.h | 61
> ++++++++++++++++++++++++------------------------
> util/aio-wait.c | 2 +-
> 2 files changed, 31 insertions(+), 32 deletions(-)
Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block
Stefan
signature.asc
Description: PGP signature