[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v3 for-2.11 2/4] coroutine: abort if we try to s
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-block] [PATCH v3 for-2.11 2/4] coroutine: abort if we try to schedule or enter a pending coroutine |
Date: |
Tue, 21 Nov 2017 16:39:33 +0000 |
User-agent: |
Mutt/1.9.1 (2017-09-22) |
On Tue, Nov 21, 2017 at 10:38:51AM -0500, Jeff Cody wrote:
> diff --git a/util/qemu-coroutine.c b/util/qemu-coroutine.c
> index d6095c1..9e4ed43 100644
> --- a/util/qemu-coroutine.c
> +++ b/util/qemu-coroutine.c
> @@ -107,8 +107,21 @@ void qemu_aio_coroutine_enter(AioContext *ctx, Coroutine
> *co)
> Coroutine *self = qemu_coroutine_self();
> CoroutineAction ret;
>
> + /* Prior read of co protected by callers - e.g., aio_co_wake */
> + const char *scheduled = atomic_read(&co->scheduled);
Consider: user code -> qemu_coroutine_enter() ->
qemu_aio_coroutine_enter(). Unlike the
aio_co_wake() code path, there is no read barrier here.
I think atomic_mb_read() is needed to guarantee the thread sees the
latest value.
signature.asc
Description: PGP signature
- [Qemu-block] [PATCH v3 for-2.11 0/4] Fix segfault in blockjob race condition, Jeff Cody, 2017/11/21
- [Qemu-block] [PATCH v3 for-2.11 2/4] coroutine: abort if we try to schedule or enter a pending coroutine, Jeff Cody, 2017/11/21
- Re: [Qemu-block] [PATCH v3 for-2.11 2/4] coroutine: abort if we try to schedule or enter a pending coroutine,
Stefan Hajnoczi <=
- [Qemu-block] [PATCH v3 for-2.11 1/4] blockjob: do not allow coroutine double entry or entry-after-completion, Jeff Cody, 2017/11/21
- [Qemu-block] [PATCH v3 for-2.11 3/4] qemu-iotests: add option in common.qemu for mismatch only, Jeff Cody, 2017/11/21
- [Qemu-block] [PATCH v3 for-2.11 4/4] qemu-iotest: add test for blockjob coroutine race condition, Jeff Cody, 2017/11/21
- Re: [Qemu-block] [PATCH v3 for-2.11 0/4] Fix segfault in blockjob race condition, Stefan Hajnoczi, 2017/11/21
- Re: [Qemu-block] [PATCH v3 for-2.11 0/4] Fix segfault in blockjob race condition, Jeff Cody, 2017/11/21