From: Pavel Begunkov asml.silence@gmail.com
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 asml.silence@gmail.com Signed-off-by: Jens Axboe axboe@kernel.dk Signed-off-by: Zhihao Cheng chengzhihao1@huawei.com 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 | 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; }