Re: [Qemu-block] [QEMU-devel][PATCH v3] aio-posix: Fix concurrent aio_poll/set_fd_handler.

2018-12-20 Thread Remy NOEL
On 12/19/18 8:32 PM, Paolo Bonzini wrote: You found another bug then. :) K. Will fix.

Re: [Qemu-block] [QEMU-devel][PATCH v3] aio-posix: Fix concurrent aio_poll/set_fd_handler.

2018-12-19 Thread Paolo Bonzini
On 19/12/18 17:29, Remy NOEL wrote: >> >> >>> atomic_read(&ctx->poll_disable_cnt) + >>> poll_disable_change); >>>   -    aio_epoll_update(ctx, node, is_new); >>> +    if (new_node) { >>> +    aio_epoll_update(ctx, new_node, is_new); >>> +    } >>>   qemu_lockcnt_unlock(&ctx

Re: [Qemu-block] [QEMU-devel][PATCH v3] aio-posix: Fix concurrent aio_poll/set_fd_handler.

2018-12-19 Thread Remy NOEL
On 12/18/18 3:14 PM, Stefan Hajnoczi wrote: Please include a changelog in future patches. For example: v3: * Don't drop revents when a handler is modified [Stefan] That way reviewers know what to look for and which issues you have addressed. Sorry, wasn't sure i had to do this in single com

Re: [Qemu-block] [QEMU-devel][PATCH v3] aio-posix: Fix concurrent aio_poll/set_fd_handler.

2018-12-19 Thread Remy NOEL
On 12/18/18 6:39 PM, Paolo Bonzini wrote: On 17/12/18 17:48, remy.n...@blade-group.com wrote: Also, we do not call aio_epoll_update for deleted handlers as this has no impact whatsoever. Why? epoll is used in level-triggered mode, so you do have to remove the file descriptor...

Re: [Qemu-block] [QEMU-devel][PATCH v3] aio-posix: Fix concurrent aio_poll/set_fd_handler.

2018-12-18 Thread Paolo Bonzini
On 17/12/18 17:48, remy.n...@blade-group.com wrote: > Also, we do not call aio_epoll_update for deleted handlers as this has > no impact whatsoever. Why? epoll is used in level-triggered mode, so you do have to remove the file descriptor... > atomic_read(&ctx->poll_disable_cnt) +

Re: [Qemu-block] [QEMU-devel][PATCH v3] aio-posix: Fix concurrent aio_poll/set_fd_handler.

2018-12-18 Thread Stefan Hajnoczi
On Mon, Dec 17, 2018 at 05:48:47PM +0100, remy.n...@blade-group.com wrote: > From: Remy Noel > > It is possible for an io_poll callback to be concurrently executed along > with an aio_set_fd_handlers. This can cause all sorts of problems, like > a NULL callback or a bad opaque pointer. > > This

Re: [Qemu-block] [QEMU-devel][PATCH v3] aio-posix: Fix concurrent aio_poll/set_fd_handler.

2018-12-18 Thread Stefan Hajnoczi
On Mon, Dec 17, 2018 at 05:48:47PM +0100, remy.n...@blade-group.com wrote: > From: Remy Noel > > It is possible for an io_poll callback to be concurrently executed along > with an aio_set_fd_handlers. This can cause all sorts of problems, like > a NULL callback or a bad opaque pointer. > > This

[Qemu-block] [QEMU-devel][PATCH v3] aio-posix: Fix concurrent aio_poll/set_fd_handler.

2018-12-17 Thread remy . noel
From: Remy Noel It is possible for an io_poll callback to be concurrently executed along with an aio_set_fd_handlers. This can cause all sorts of problems, like a NULL callback or a bad opaque pointer. This changes set_fd_handlers so that it no longer modify existing handlers entries and instead