Re: [PATCH 32/32] aio: implement io_pgetevents

2018-01-17 Thread Jeff Moyer
Christoph Hellwig writes: > On Tue, Jan 16, 2018 at 07:41:24PM -0500, Jeff Moyer wrote: >> I'd be willing to bet the issue is in your io_syscall6 implementation. >> You pass in arg5 where arg6 should be used. Don't feel bad, it took me >> the better part of today to figure that

Re: [PATCH 32/32] aio: implement io_pgetevents

2018-01-17 Thread Jeff Moyer
Christoph Hellwig writes: > On Wed, Jan 17, 2018 at 04:27:21AM +, Al Viro wrote: >> On Tue, Jan 16, 2018 at 07:41:24PM -0500, Jeff Moyer wrote: >> >if (sigmask) { >> > - if (copy_from_user(, sigmask, sizeof(ksigmask))) >> > + if (!access_ok(VERIFY_READ,

Re: [PATCH 32/32] aio: implement io_pgetevents

2018-01-16 Thread Christoph Hellwig
On Tue, Jan 16, 2018 at 07:41:24PM -0500, Jeff Moyer wrote: > I'd be willing to bet the issue is in your io_syscall6 implementation. > You pass in arg5 where arg6 should be used. Don't feel bad, it took me > the better part of today to figure that out. :) > > Here's an incremental diff on top

Re: [PATCH 32/32] aio: implement io_pgetevents

2018-01-16 Thread Christoph Hellwig
On Wed, Jan 17, 2018 at 04:27:21AM +, Al Viro wrote: > On Tue, Jan 16, 2018 at 07:41:24PM -0500, Jeff Moyer wrote: > > if (sigmask) { > > - if (copy_from_user(, sigmask, sizeof(ksigmask))) > > + if (!access_ok(VERIFY_READ, sigmask, > > +

Re: [PATCH 32/32] aio: implement io_pgetevents

2018-01-16 Thread Al Viro
On Tue, Jan 16, 2018 at 07:41:24PM -0500, Jeff Moyer wrote: > if (sigmask) { > - if (copy_from_user(, sigmask, sizeof(ksigmask))) > + if (!access_ok(VERIFY_READ, sigmask, > +sizeof(void *) + sizeof(size_t)) || > +

Re: [PATCH 32/32] aio: implement io_pgetevents

2018-01-16 Thread Jeff Moyer
Hi, Christoph, Christoph Hellwig writes: > On Mon, Jan 15, 2018 at 09:53:10AM +0100, Christoph Hellwig wrote: >> > pselect, as an example, crams the sigmask and size together. Why not >> > just do that? libaio can take care of setting that up. >> >> Yes, I could try that. It's

Re: [PATCH 32/32] aio: implement io_pgetevents

2018-01-16 Thread Christoph Hellwig
On Mon, Jan 15, 2018 at 09:53:10AM +0100, Christoph Hellwig wrote: > > pselect, as an example, crams the sigmask and size together. Why not > > just do that? libaio can take care of setting that up. > > Yes, I could try that. It's just another double indirection for no > good reason. I cna't

Re: [PATCH 32/32] aio: implement io_pgetevents

2018-01-15 Thread Christoph Hellwig
On Fri, Jan 12, 2018 at 03:44:52PM -0500, Jeff Moyer wrote: > Christoph Hellwig writes: > > > This is the io_getevents equivalent of ppoll/pselect and allows to > > properly mix signals and aio completions (especially with IOCB_CMD_POLL) > > and atomically executes the following

Re: [PATCH 32/32] aio: implement io_pgetevents

2018-01-12 Thread Jeff Moyer
Christoph Hellwig writes: > This is the io_getevents equivalent of ppoll/pselect and allows to > properly mix signals and aio completions (especially with IOCB_CMD_POLL) > and atomically executes the following sequence: > > sigset_t origmask; > >

[PATCH 32/32] aio: implement io_pgetevents

2018-01-10 Thread Christoph Hellwig
This is the io_getevents equivalent of ppoll/pselect and allows to properly mix signals and aio completions (especially with IOCB_CMD_POLL) and atomically executes the following sequence: sigset_t origmask; pthread_sigmask(SIG_SETMASK, , ); ret = io_getevents(ctx, min_nr,