Skip to contentSkip to conversation

io_uring: fail links of cancelled timeouts

PATCH Applied Pavel Begunkov 2 participants 2 messages Sep 9, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 io_uring: fail links of cancelled timeouts

When we cancel a timeout we should mark it with REQ_F_FAIL, so linked requests are cancelled as well, but not queued for further execution.

---
 fs/io_uring.c | 2 ++
 1 file changed, 2 insertions(+)
fs/io_uring.c +2 -0
index aabc2b489831..e6ccdae189b0 100644
@@ -1486,6 +1486,8 @@ static void io_kill_timeout(struct io_kiocb *req, int status)
 	struct io_timeout_data *io = req->async_data;
 
 	if (hrtimer_try_to_cancel(&io->timer) != -1) {
+		if (status)
+			req_set_fail(req);
 		atomic_set(&req->ctx->cq_timeouts,
 			atomic_read(&req->ctx->cq_timeouts) + 1);
 		list_del_init(&req->timeout.list);
Signature · 1 line
2.33.0
maintainer Applied
#1 lore raw
Quoted 3 lines · Pavel Begunkov

When we cancel a timeout we should mark it with REQ_F_FAIL, so linked requests are cancelled as well, but not queued for further execution.

Applied, thanks.

Signature · 1 line
Jens Axboe