Re: [PATCH 3/4] nbd: make client_close synchronous

2020-07-01 Thread Vladimir Sementsov-Ogievskiy
29.06.2020 16:56, Stefan Hajnoczi wrote: On Mon, Jun 29, 2020 at 10:55:06AM +0300, Vladimir Sementsov-Ogievskiy wrote: Also, why in block/io.c we kick the main context, but not bs->aio_context? From AIO_WAIT_WHILE(): * The caller's thread must be the IOThread that owns @ctx or the main

Re: [PATCH 3/4] nbd: make client_close synchronous

2020-06-29 Thread Stefan Hajnoczi
On Mon, Jun 29, 2020 at 10:55:06AM +0300, Vladimir Sementsov-Ogievskiy wrote: > Also, why in block/io.c we kick the main context, but not bs->aio_context? >From AIO_WAIT_WHILE(): * The caller's thread must be the IOThread that owns @ctx or the main loop * thread (with @ctx acquired exactly

Re: [PATCH 3/4] nbd: make client_close synchronous

2020-06-29 Thread Vladimir Sementsov-Ogievskiy
25.06.2020 17:25, Vladimir Sementsov-Ogievskiy wrote: client_close doesn't guarantee that client is closed: nbd_trip() keeps reference to it. Let's wait for nbd_trip to finish. Without this fix, the following crash is possible: - export bitmap through unternal Qemu NBD server - connect a

Re: [PATCH 3/4] nbd: make client_close synchronous

2020-06-25 Thread Eric Blake
On 6/25/20 9:25 AM, Vladimir Sementsov-Ogievskiy wrote: client_close doesn't guarantee that client is closed: nbd_trip() keeps reference to it. Let's wait for nbd_trip to finish. Without this fix, the following crash is possible: - export bitmap through unternal Qemu NBD server internal -

[PATCH 3/4] nbd: make client_close synchronous

2020-06-25 Thread Vladimir Sementsov-Ogievskiy
client_close doesn't guarantee that client is closed: nbd_trip() keeps reference to it. Let's wait for nbd_trip to finish. Without this fix, the following crash is possible: - export bitmap through unternal Qemu NBD server - connect a client - shutdown Qemu On shutdown nbd_export_close_all is