提交 4673cfc7 编写于 作者: Y yangerkun 提交者: Shile Zhang

io_uring: fix logic error in io_timeout

commit 8b07a65ad30e5612d9590fb50468ff4fa314cfc7 upstream.

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

Fixes: 5da0fb1ab34c ("io_uring: consider the overflow of sequence for timeout req")
Signed-off-by: Nyangerkun <yangerkun@huawei.com>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
Signed-off-by: NJoseph Qi <joseph.qi@linux.alibaba.com>
Reviewed-by: NXiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
上级 4b4f9111
......@@ -1948,7 +1948,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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册