diff options
author | Stefan Hajnoczi <stefanha@redhat.com> | 2018-03-07 12:46:19 +0000 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2018-03-12 11:07:37 +0000 |
commit | 7376eda7c2e0451e819e81bd05fabc56a9deb946 (patch) | |
tree | c5a89490ebd3871f68331544ad39567ca4f0e832 /util/uuid.c | |
parent | e4ae62b802cec437f877f2cadc4ef059cc0eca76 (diff) | |
download | qemu-7376eda7c2e0451e819e81bd05fabc56a9deb946.zip qemu-7376eda7c2e0451e819e81bd05fabc56a9deb946.tar.gz qemu-7376eda7c2e0451e819e81bd05fabc56a9deb946.tar.bz2 |
block: make BDRV_POLL_WHILE() re-entrancy safe
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)" <fuweiwei2@huawei.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20180307124619.6218-1-stefanha@redhat.com
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'util/uuid.c')
0 files changed, 0 insertions, 0 deletions