diff mbox series

[1/2] fs: use current->mm for io_uring

Message ID 20200423145215.72666-1-minchan@kernel.org (mailing list archive)
State New, archived
Headers show
Series [1/2] fs: use current->mm for io_uring | expand

Commit Message

Minchan Kim April 23, 2020, 2:52 p.m. UTC
per-request by Jens,
https://lore.kernel.org/io-uring/46e5b8bf-0f14-caff-f706-91794191e730@kernel.dk/

Andrew, please fold this into "mm/madvise: pass task and mm to do_madvise"

Cc: Jens Axboe <axboe@kernel.dk>
Cc: Jann Horn <jannh@google.com>
Signed-off-by: Minchan Kim <minchan@kernel.org>
---
 fs/io_uring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 54b7c4818289..94af6cd05fb5 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -3267,7 +3267,7 @@  static int io_madvise(struct io_kiocb *req, bool force_nonblock)
 	if (force_nonblock)
 		return -EAGAIN;
 
-	ret = do_madvise(NULL, req->work.mm, 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);