]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
io_uring: drop mm/files between task_work_submit
authorPavel Begunkov <asml.silence@gmail.com>
Thu, 4 Feb 2021 19:22:46 +0000 (19:22 +0000)
committerJens Axboe <axboe@kernel.dk>
Thu, 4 Feb 2021 19:42:58 +0000 (12:42 -0700)
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>
fs/io_uring.c

index 5d3348d66f068cc9f9bf75a7aafacb2d656dbd45..1f68105a41ed996622a4c35dbcb6e97e55e00922 100644 (file)
@@ -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)