Skip to content

Commit

Permalink
io_uring: drop mm/files between task_work_submit
Browse files Browse the repository at this point in the history
Since SQPOLL task can be shared and so task_work entries can be a mix of
them, we need to drop mm and files before trying to issue next request.

Cc: stable@vger.kernel.org # 5.10+
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Pavel Begunkov authored and Jens Axboe committed Feb 4, 2021
1 parent d7e10d4 commit aec18a5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -2205,6 +2205,9 @@ static void __io_req_task_submit(struct io_kiocb *req)
else
__io_req_task_cancel(req, -EFAULT);
mutex_unlock(&ctx->uring_lock);

if (ctx->flags & IORING_SETUP_SQPOLL)
io_sq_thread_drop_mm_files();
}

static void io_req_task_submit(struct callback_head *cb)
Expand Down

0 comments on commit aec18a5

Please sign in to comment.