[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-1.4 stable] block: handle spurious coroutine
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH for-1.4 stable] block: handle spurious coroutine entries |
Date: |
Mon, 11 Feb 2013 13:29:31 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 |
Am 09.02.2013 17:44, schrieb Stefan Hajnoczi:
> bdrv_co_io_em(), bdrv_co_flush(), and bdrv_co_discard() yield the
> coroutine when waiting for aio to complete. They do not check that the
> request has actually finished.
>
> In simple cases this works, but it returns early when we get spurious
> wake-ups due to qemu_coroutine_enter() being called from other sources.
> One such example is block-migration.c:process_incoming_migration().
The bug is not in this function but in process_incoming_migration(). It
should never blindly enter a coroutine which is in an unknown state. If
it can reenter here, it can reenter anywhere in block drivers, and
adding a workaround to one place that just yields again if it got an
early reentrance doesn't fix the real bug.
Which is the yield that corresponds to the enter in
enter_migration_coroutine()? We need to add some state that can be used
to make sure the enter happens only for this specific yield.
Kevin