* [PATCH] io_uring: fix logic error in io_timeout
@ 2019-10-17 4:12 yangerkun
2019-10-17 17:27 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: yangerkun @ 2019-10-17 4:12 UTC (permalink / raw)
To: axboe, linux-block; +Cc: yangerkun, yi.zhang, houtao1
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>
---
fs/io_uring.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/io_uring.c b/fs/io_uring.c
index d2cb277da2f4..8781ab37b170 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -1934,7 +1934,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;
--
2.17.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] io_uring: fix logic error in io_timeout
2019-10-17 4:12 [PATCH] io_uring: fix logic error in io_timeout yangerkun
@ 2019-10-17 17:27 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2019-10-17 17:27 UTC (permalink / raw)
To: yangerkun, linux-block; +Cc: yi.zhang, houtao1
On 10/16/19 10:12 PM, yangerkun wrote:
> If ctx->cached_sq_head < nxt_sq_head, we should add UINT_MAX to tmp, not
> tmp_nxt.
Applied, thanks.
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-10-17 17:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-17 4:12 [PATCH] io_uring: fix logic error in io_timeout yangerkun
2019-10-17 17:27 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).