Re: [Qemu-devel] [PATCH 06/14] block: Add missing locking in bdrv_co_drain_bh_cb()

2018-09-11 Thread Kevin Wolf
Am 11.09.2018 um 11:28 hat Sergio Lopez geschrieben: > On Tue, Sep 11, 2018 at 11:17:20AM +0200, Kevin Wolf wrote: > > Am 11.09.2018 um 10:23 hat Fam Zheng geschrieben: > > > On Fri, 09/07 18:15, Kevin Wolf wrote: > > > > bdrv_do_drained_begin/end() assume that they are called with the > > > > AioC

Re: [Qemu-devel] [PATCH 06/14] block: Add missing locking in bdrv_co_drain_bh_cb()

2018-09-11 Thread Sergio Lopez
On Tue, Sep 11, 2018 at 11:17:20AM +0200, Kevin Wolf wrote: > Am 11.09.2018 um 10:23 hat Fam Zheng geschrieben: > > On Fri, 09/07 18:15, Kevin Wolf wrote: > > > bdrv_do_drained_begin/end() assume that they are called with the > > > AioContext lock of bs held. If we call drain functions from a corou

Re: [Qemu-devel] [PATCH 06/14] block: Add missing locking in bdrv_co_drain_bh_cb()

2018-09-11 Thread Kevin Wolf
Am 11.09.2018 um 10:23 hat Fam Zheng geschrieben: > On Fri, 09/07 18:15, Kevin Wolf wrote: > > bdrv_do_drained_begin/end() assume that they are called with the > > AioContext lock of bs held. If we call drain functions from a coroutine > > with the AioContext lock held, we yield and schedule a BH t

Re: [Qemu-devel] [PATCH 06/14] block: Add missing locking in bdrv_co_drain_bh_cb()

2018-09-11 Thread Fam Zheng
On Fri, 09/07 18:15, Kevin Wolf wrote: > bdrv_do_drained_begin/end() assume that they are called with the > AioContext lock of bs held. If we call drain functions from a coroutine > with the AioContext lock held, we yield and schedule a BH to move out of > coroutine context. This means that the loc

[Qemu-devel] [PATCH 06/14] block: Add missing locking in bdrv_co_drain_bh_cb()

2018-09-07 Thread Kevin Wolf
bdrv_do_drained_begin/end() assume that they are called with the AioContext lock of bs held. If we call drain functions from a coroutine with the AioContext lock held, we yield and schedule a BH to move out of coroutine context. This means that the lock for the home context of the coroutine is rele