From: Jens Axboe axboe@kernel.dk
mainline inclusion from mainline-5.9-rc1 commit 4349f30ecb8068d146a1e57bb12f46e745323b4c category: feature bugzilla: https://bugzilla.openeuler.org/show_bug.cgi?id=27 CVE: NA ---------------------------
We don't use 'ctx' at all in io_sq_thread_drop_mm(), it just works on the mm of the current task. Drop the argument.
Move io_file_put_work() to where we have the other forward declarations of functions.
Signed-off-by: Jens Axboe axboe@kernel.dk
Conflicts: fs/io_uring.c
Signed-off-by: yangerkun yangerkun@huawei.com Reviewed-by: zhangyi (F) yi.zhang@huawei.com Signed-off-by: Cheng Jian cj.chengjian@huawei.com --- fs/io_uring.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/io_uring.c b/fs/io_uring.c index 0420e098ad54..e4bc79041880 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -4284,7 +4284,7 @@ static void io_async_queue_proc(struct file *file, struct wait_queue_head *head, __io_queue_proc(&apoll->poll, pt, head, &apoll->double_poll); }
-static void io_sq_thread_drop_mm(struct io_ring_ctx *ctx) +static void io_sq_thread_drop_mm(void) { struct mm_struct *mm = current->mm;
@@ -6066,7 +6066,7 @@ static int io_sq_thread(void *data) * adding ourselves to the waitqueue, as the unuse/drop * may sleep. */ - io_sq_thread_drop_mm(ctx); + io_sq_thread_drop_mm();
/* * We're polling. If we're within the defined idle @@ -6139,7 +6139,7 @@ static int io_sq_thread(void *data) task_work_run();
set_fs(old_fs); - io_sq_thread_drop_mm(ctx); + io_sq_thread_drop_mm(); revert_creds(old_cred);
kthread_parkme();