Linked timeouts are never refcounted when it comes to the first call to __io_prep_linked_timeout(), so save an io_ref_get() and set the desired value directly. Signed-off-by: Pavel Begunkov <asml.silence@xxxxxxxxx> --- fs/io_uring.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index d572a831cf85..37b5516b63c8 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -1310,8 +1310,7 @@ static struct io_kiocb *__io_prep_linked_timeout(struct io_kiocb *req) /* linked timeouts should have two refs once prep'ed */ io_req_refcount(req); - io_req_refcount(nxt); - req_ref_get(nxt); + __io_req_refcount(nxt, 2); nxt->timeout.head = req; nxt->flags |= REQ_F_LTIMEOUT_ACTIVE; -- 2.32.0