On 10/20/21 09:33, Pavel Begunkov wrote:
On 10/20/21 02:48, Jens Axboe wrote:
On 10/19/21 7:26 PM, Pavel Begunkov wrote:
io_unprep_linked_timeout() is broken, first it needs to return back
REQ_F_ARM_LTIMEOUT, so the linked timeout is enqueued and disarmed. But
now we refcounted it, and linked timeouts may get not executed at all,
leaking a request.
Just kill the unprep optimisation.
This appears to be against something that is not 5.15, can you please
check the end result:
Yeah, it was 5.16 for some reason. Looks good, thanks!
Actually, it's not. We need either unprep but "smarter" or queue the
timeout. I'll send a v2 for convenience, but a fold in is below.
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 36db7b76cf8d..d5cc103224f1 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -6979,6 +6979,8 @@ static void __io_queue_sqe(struct io_kiocb *req)
switch (io_arm_poll_handler(req)) {
case IO_APOLL_READY:
+ if (linked_timeout)
+ io_queue_linked_timeout(linked_timeout);
goto issue_sqe;
case IO_APOLL_ABORTED:
/*
--
Pavel Begunkov