diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2016-09-28 20:13:05 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2016-09-28 20:13:05 +0100 |
commit | bc63afaf5f6d906ff56608b52d575ac8dbb09062 (patch) | |
tree | 3f727bcf3ffd719f04aa15e3059ff5851aa40f57 /block/linux-aio.c | |
parent | 4af27939e5232c130327066e47eb805be0be1438 (diff) | |
parent | fe121b9d3c4258e41f7efa4976bf79151b2d5dbb (diff) |
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging
# gpg: Signature made Wed 28 Sep 2016 19:15:22 BST
# gpg: using RSA key 0x9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
# gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>"
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8
* remotes/stefanha/tags/block-pull-request:
linux-aio: fix re-entrant completion processing
test-coroutine: test qemu_coroutine_entered()
coroutine: add qemu_coroutine_entered() function
libqos: fix qvring_init()
iothread: check iothread->ctx before aio_context_unref to avoid assertion
aio-posix: avoid unnecessary aio_epoll_enabled() calls
block: mirror: fix wrong comment of mirror_start
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'block/linux-aio.c')
-rw-r--r-- | block/linux-aio.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/block/linux-aio.c b/block/linux-aio.c index d4e19d444c..1685ec29a3 100644 --- a/block/linux-aio.c +++ b/block/linux-aio.c @@ -94,9 +94,12 @@ static void qemu_laio_process_completion(struct qemu_laiocb *laiocb) laiocb->ret = ret; if (laiocb->co) { - /* Jump and continue completion for foreign requests, don't do - * anything for current request, it will be completed shortly. */ - if (laiocb->co != qemu_coroutine_self()) { + /* If the coroutine is already entered it must be in ioq_submit() and + * will notice laio->ret has been filled in when it eventually runs + * later. Coroutines cannot be entered recursively so avoid doing + * that! + */ + if (!qemu_coroutine_entered(laiocb->co)) { qemu_coroutine_enter(laiocb->co); } } else { |