io_req_task_timeout() closely follows io_req_task_cancel(), so remove it and replace with io_req_task_queue_fail(). Signed-off-by: Pavel Begunkov <asml.silence@xxxxxxxxx> --- fs/io_uring.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index bdab831a1185..581c994a4e4f 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -5529,12 +5529,6 @@ static int io_poll_update(struct io_kiocb *req, unsigned int issue_flags) return 0; } -static void io_req_task_timeout(struct io_kiocb *req) -{ - req_set_fail(req); - io_req_complete_post(req, -ETIME, 0); -} - static enum hrtimer_restart io_timeout_fn(struct hrtimer *timer) { struct io_timeout_data *data = container_of(timer, @@ -5549,8 +5543,7 @@ static enum hrtimer_restart io_timeout_fn(struct hrtimer *timer) atomic_read(&req->ctx->cq_timeouts) + 1); spin_unlock_irqrestore(&ctx->timeout_lock, flags); - req->io_task_work.func = io_req_task_timeout; - io_req_task_work_add(req); + io_req_task_queue_fail(req, -ETIME); return HRTIMER_NORESTART; } -- 2.32.0