Re: [PATCH 10/32] aio: implement IOCB_CMD_POLL

2018-05-20 Thread Christoph Hellwig
On Sun, May 20, 2018 at 08:33:39AM +0100, Al Viro wrote: > > ... get buggered on attempt to dereference a pointer fetched from freed and > > reused object. > > FWIW, how painful would it be to pull the following trick: > * insert into wait queue under ->ctx_lock > * have wakeup do sche

Re: [PATCH 10/32] aio: implement IOCB_CMD_POLL

2018-05-20 Thread Al Viro
On Sun, May 20, 2018 at 06:32:25AM +0100, Al Viro wrote: > > + spin_lock_irqsave(&ctx->ctx_lock, flags); > > + list_add_tail(&aiocb->ki_list, &ctx->delayed_cancel_reqs); > > + spin_unlock(&ctx->ctx_lock); > > ... and io_cancel(2) comes, finds it and inhume^Wcompletes it, leaving us > to...

Re: [PATCH 10/32] aio: implement IOCB_CMD_POLL

2018-05-19 Thread Al Viro
On Tue, May 15, 2018 at 09:48:11PM +0200, Christoph Hellwig wrote: > +static ssize_t aio_poll(struct aio_kiocb *aiocb, struct iocb *iocb) > +{ > + struct kioctx *ctx = aiocb->ki_ctx; > + struct poll_iocb *req = &aiocb->poll; > + unsigned long flags; > + __poll_t mask; > + > + /*

[PATCH 10/32] aio: implement IOCB_CMD_POLL

2018-05-15 Thread Christoph Hellwig
Simple one-shot poll through the io_submit() interface. To poll for a file descriptor the application should submit an iocb of type IOCB_CMD_POLL. It will poll the fd for the events specified in the the first 32 bits of the aio_buf field of the iocb. Unlike poll or epoll without EPOLLONESHOT thi

[PATCH 10/32] aio: implement IOCB_CMD_POLL

2018-05-11 Thread Christoph Hellwig
Simple one-shot poll through the io_submit() interface. To poll for a file descriptor the application should submit an iocb of type IOCB_CMD_POLL. It will poll the fd for the events specified in the the first 32 bits of the aio_buf field of the iocb. Unlike poll or epoll without EPOLLONESHOT thi

[PATCH 10/32] aio: implement IOCB_CMD_POLL

2018-03-30 Thread Christoph Hellwig
Simple one-shot poll through the io_submit() interface. To poll for a file descriptor the application should submit an iocb of type IOCB_CMD_POLL. It will poll the fd for the events specified in the the first 32 bits of the aio_buf field of the iocb. Unlike poll or epoll without EPOLLONESHOT thi