From: yangerkun Date: Thu, 17 Oct 2019 04:12:35 +0000 (+0800) Subject: io_uring: fix logic error in io_timeout X-Git-Tag: v5.4-rc4~8^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8b07a65ad30e5612d9590fb50468ff4fa314cfc7;p=platform%2Fkernel%2Flinux-rpi.git 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: 5da0fb1ab34c ("io_uring: consider the overflow of sequence for timeout req") Signed-off-by: yangerkun Signed-off-by: Jens Axboe --- diff --git a/fs/io_uring.c b/fs/io_uring.c index b7d4085..1d03afd 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -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;