Re: [Qemu-devel] [PATCH] aio: fix qemu_bh_schedule() bh-ctx race condition

2014-06-04 Thread Stefan Hajnoczi
On Tue, Jun 03, 2014 at 02:52:40PM +0200, Stefan Priebe - Profihost AG wrote: Tested-by: Stefan Priebe s.pri...@profihost.ag Thanks!

[Qemu-devel] [PATCH] aio: fix qemu_bh_schedule() bh-ctx race condition

2014-06-03 Thread Stefan Hajnoczi
qemu_bh_schedule() is supposed to be thread-safe at least the first time it is called. Unfortunately this is not quite true: bh-scheduled = 1; aio_notify(bh-ctx); Since another thread may run the BH callback once it has been scheduled, there is a race condition if the callback frees the BH

Re: [Qemu-devel] [PATCH] aio: fix qemu_bh_schedule() bh-ctx race condition

2014-06-03 Thread Paolo Bonzini
Il 03/06/2014 11:21, Stefan Hajnoczi ha scritto: qemu_bh_schedule() is supposed to be thread-safe at least the first time it is called. Unfortunately this is not quite true: bh-scheduled = 1; aio_notify(bh-ctx); Since another thread may run the BH callback once it has been scheduled,

Re: [Qemu-devel] [PATCH] aio: fix qemu_bh_schedule() bh-ctx race condition

2014-06-03 Thread Stefan Hajnoczi
On Tue, Jun 03, 2014 at 11:21:01AM +0200, Stefan Hajnoczi wrote: qemu_bh_schedule() is supposed to be thread-safe at least the first time it is called. Unfortunately this is not quite true: bh-scheduled = 1; aio_notify(bh-ctx); Since another thread may run the BH callback once it has

Re: [Qemu-devel] [PATCH] aio: fix qemu_bh_schedule() bh-ctx race condition

2014-06-03 Thread Stefan Priebe - Profihost AG
Tested-by: Stefan Priebe s.pri...@profihost.ag Am 03.06.2014 11:21, schrieb Stefan Hajnoczi: qemu_bh_schedule() is supposed to be thread-safe at least the first time it is called. Unfortunately this is not quite true: bh-scheduled = 1; aio_notify(bh-ctx); Since another thread may