Re: [Qemu-devel] [PATCH 1/3] aio-posix: fix concurrent access to poll_disable_cnt

2018-09-12 Thread Fam Zheng
On Wed, 09/12 19:10, Paolo Bonzini wrote: > It is valid for an aio_set_fd_handler to happen concurrently with > aio_poll. In that case, poll_disable_cnt can change under the heels > of aio_poll, and the assertion on poll_disable_cnt can fail in > run_poll_handlers. > > Therefore, this patch simpl

[Qemu-devel] [PATCH 1/3] aio-posix: fix concurrent access to poll_disable_cnt

2018-09-12 Thread Paolo Bonzini
It is valid for an aio_set_fd_handler to happen concurrently with aio_poll. In that case, poll_disable_cnt can change under the heels of aio_poll, and the assertion on poll_disable_cnt can fail in run_poll_handlers. Therefore, this patch simply checks the counter on every polling iteration. Ther