[PATCH v2 1/5] block/nbd: Fix hang in .bdrv_close()

2020-01-22 Thread Max Reitz
When nbd_close() is called from a coroutine, the connection_co never gets to run, and thus nbd_teardown_connection() hangs. This is because aio_co_enter() only puts the connection_co into the main coroutine's wake-up queue, so this main coroutine needs to yield and wait for connection_co to termin

Re: [PATCH v2 1/5] block/nbd: Fix hang in .bdrv_close()

2020-01-22 Thread Eric Blake
On 1/22/20 10:45 AM, Max Reitz wrote: When nbd_close() is called from a coroutine, the connection_co never gets to run, and thus nbd_teardown_connection() hangs. This is because aio_co_enter() only puts the connection_co into the main coroutine's wake-up queue, so this main coroutine needs to yi

Re: [PATCH v2 1/5] block/nbd: Fix hang in .bdrv_close()

2020-01-23 Thread Maxim Levitsky
On Wed, 2020-01-22 at 17:45 +0100, Max Reitz wrote: > When nbd_close() is called from a coroutine, the connection_co never > gets to run, and thus nbd_teardown_connection() hangs. > > This is because aio_co_enter() only puts the connection_co into the main > coroutine's wake-up queue, so this main