]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitc72ed6d64a2146ed5191753a580830ce29cae1fb
treea49ff15c524951452747ecfbdc24e4fad32180b7
parentb56d689c15e1fc420b7f0724fbefac7a7de7b030
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: ffe0145b7622 ("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