From d67d819a79c4f42e7969b5230b35cdc44d519119 Mon Sep 17 00:00:00 2001 From: Pavel Begunkov Date: Thu, 15 Apr 2021 17:33:55 +0800 Subject: [PATCH] io_uring: simplify io_req_link_next() mainline inclusion from mainline-5.5-rc1 commit b18fdf71e01fba29a804d63f8c1e2ed61011170d category: feature bugzilla: https://bugzilla.openeuler.org/show_bug.cgi?id=27 CVE: NA --------------------------- "if (nxt)" is always true, as it was checked in the while's condition. io_wq_current_is_worker() is unnecessary, as non-async callers don't pass nxt, so io_queue_async_work() will be called for them anyway. Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe Signed-off-by: Zhihao Cheng Signed-off-by: yangerkun Reviewed-by: zhangyi (F) Signed-off-by: Cheng Jian --- fs/io_uring.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index c9e15ac37178..cd04220944b3 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -902,16 +902,7 @@ static void io_req_link_next(struct io_kiocb *req, struct io_kiocb **nxtptr) nxt->flags |= REQ_F_LINK; } - /* - * If we're in async work, we can continue processing the chain - * in this context instead of having to queue up new async work. - */ - if (nxt) { - if (io_wq_current_is_worker()) - *nxtptr = nxt; - else - io_queue_async_work(nxt); - } + *nxtptr = nxt; break; } -- GitLab