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: 5da0fb1ab3 ("io_uring: consider the overflow of sequence for timeout req")
Signed-off-by: yangerkun <yangerkun@huawei.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
yangerkun 2019-10-17 12:12:35 +08:00 committed by Jens Axboe
parent 491381ce07
commit 8b07a65ad3
1 changed files with 1 additions and 1 deletions

View File

@ -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;