Skip to content

Commit 8b07a65

Browse files
yangerkunaxboe
authored andcommitted
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: 5da0fb1 ("io_uring: consider the overflow of sequence for timeout req") Signed-off-by: yangerkun <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 491381c commit 8b07a65

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/io_uring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1949,7 +1949,7 @@ static int io_timeout(struct io_kiocb *req, const struct io_uring_sqe *sqe)
19491949
* once there is some timeout req still be valid.
19501950
*/
19511951
if (ctx->cached_sq_head < nxt_sq_head)
1952-
tmp_nxt += UINT_MAX;
1952+
tmp += UINT_MAX;
19531953

19541954
if (tmp >= tmp_nxt)
19551955
break;

0 commit comments

Comments
 (0)