Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8b07a65a authored by yangerkun's avatar yangerkun Committed by Jens Axboe
Browse files

io_uring: fix logic error in io_timeout



If ctx->cached_sq_head < nxt_sq_head, we should add UINT_MAX to tmp, not
tmp_nxt.

Fixes: 5da0fb1a ("io_uring: consider the overflow of sequence for timeout req")
Signed-off-by: default avataryangerkun <yangerkun@huawei.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 491381ce
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1949,7 +1949,7 @@ static int io_timeout(struct io_kiocb *req, const struct io_uring_sqe *sqe)
		 * once there is some timeout req still be valid.
		 */
		if (ctx->cached_sq_head < nxt_sq_head)
			tmp_nxt += UINT_MAX;
			tmp += UINT_MAX;

		if (tmp >= tmp_nxt)
			break;