lkml.org 
[lkml]   [2020]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v5 1/7] mm: pass task and mm to do_madvise
From
Date
On 2/14/20 11:45 AM, Minchan Kim wrote:
> diff --git a/fs/io_uring.c b/fs/io_uring.c
> index 63beda9bafc5..1c7e9cd6c8ce 100644
> --- a/fs/io_uring.c
> +++ b/fs/io_uring.c
> @@ -2736,7 +2736,7 @@ static int io_madvise(struct io_kiocb *req, struct io_kiocb **nxt,
> if (force_nonblock)
> return -EAGAIN;
>
> - ret = do_madvise(ma->addr, ma->len, ma->advice);
> + ret = do_madvise(NULL, current->mm, ma->addr, ma->len, ma->advice);
> if (ret < 0)
> req_set_fail_links(req);
> io_cqring_add_event(req, ret);

I think we want to use req->work.mm here - it'll be the same as
current->mm at this point, but it makes it clear that we're using a
grabbed mm.

--
Jens Axboe

\
 
 \ /
  Last update: 2020-02-14 20:10    [W:0.042 / U:2.744 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site