diff options
author | yangerkun <yangerkun@huawei.com> | 2019-10-17 12:12:35 +0800 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-10-17 15:49:15 -0600 |
commit | 8b07a65ad30e5612d9590fb50468ff4fa314cfc7 (patch) | |
tree | 38025726981ad1b8566e292533e580dafded9132 /fs | |
parent | 491381ce07ca57f68c49c79a8a43da5b60749e32 (diff) | |
download | linux-8b07a65ad30e5612d9590fb50468ff4fa314cfc7.tar.bz2 |
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 <yangerkun@huawei.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/io_uring.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c index b7d4085d6ffd..1d03afd74368 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; |