lkml.org 
[lkml]   [2019]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm/gup: Use put_user_page*() instead of put_page*()
On Sun, Jul 14, 2019 at 08:33:57PM -0600, Jens Axboe wrote:
> On 7/14/19 1:08 PM, Bharath Vedartham wrote:
> > diff --git a/fs/io_uring.c b/fs/io_uring.c
> > index 4ef62a4..b4a4549 100644
> > --- a/fs/io_uring.c
> > +++ b/fs/io_uring.c
> > @@ -2694,10 +2694,9 @@ static int io_sqe_buffer_register(struct io_ring_ctx *ctx, void __user *arg,
> > * if we did partial map, or found file backed vmas,
> > * release any pages we did get
> > */
> > - if (pret > 0) {
> > - for (j = 0; j < pret; j++)
> > - put_page(pages[j]);
> > - }
> > + if (pret > 0)
> > + put_user_pages(pages, pret);
> > +
> > if (ctx->account_mem)
> > io_unaccount_mem(ctx->user, nr_pages);
> > kvfree(imu->bvec);
>
> You handled just the failure case of the buffer registration, but not
> the actual free in io_sqe_buffer_unregister().
>
> --
> Jens Axboe
Yup got it! Thanks! I won't be sending a patch again as fs/io_uring.c
may have larger local changes for put_user_pages.

Thanks

\
 
 \ /
  Last update: 2019-07-15 09:01    [W:0.071 / U:7.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site