io_uring: fix ltimeout unprep
authorPavel Begunkov <asml.silence@gmail.com>
Wed, 20 Oct 2021 08:53:02 +0000 (09:53 +0100)
committerJens Axboe <axboe@kernel.dk>
Wed, 20 Oct 2021 15:54:16 +0000 (09:54 -0600)
commit4ea672ab694c23886b52e97cee10dea056e43e62
treea49ff15c524951452747ecfbdc24e4fad32180b7
parente139a1ec92f8dbaaa7380d7e7ea17e148d473d06
io_uring: fix ltimeout unprep

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.

Fixes: 906c6caaf586 ("io_uring: optimise io_prep_linked_timeout()")
Reported-by: Beld Zhang <beldzhang@gmail.com>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/51b8e2bfc4bea8ee625cf2ba62b2a350cc9be031.1634719585.git.asml.silence@gmail.com
Link: https://github.com/axboe/liburing/issues/460
Reported-by: Beld Zhang <beldzhang@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c