summaryrefslogtreecommitdiffstats
path: root/block/blk-cgroup.c
diff options
context:
space:
mode:
authoryangerkun <yangerkun@huawei.com>2019-10-15 15:59:29 +0200
committerJens Axboe <axboe@kernel.dk>2019-10-15 16:55:50 +0200
commit5da0fb1ab34ccfe6d49210b4f5a739c59fcbf25e (patch)
treec9eaf517afbc8c7dc8e2f9633ec17d6f0416e647 /block/blk-cgroup.c
parentblock: Fix elv_support_iosched() (diff)
downloadlinux-5da0fb1ab34ccfe6d49210b4f5a739c59fcbf25e.tar.xz
linux-5da0fb1ab34ccfe6d49210b4f5a739c59fcbf25e.zip
io_uring: consider the overflow of sequence for timeout req
Now we recalculate the sequence of timeout with 'req->sequence = ctx->cached_sq_head + count - 1', judge the right place to insert for timeout_list by compare the number of request we still expected for completion. But we have not consider about the situation of overflow: 1. ctx->cached_sq_head + count - 1 may overflow. And a bigger count for the new timeout req can have a small req->sequence. 2. cached_sq_head of now may overflow compare with before req. And it will lead the timeout req with small req->sequence. This overflow will lead to the misorder of timeout_list, which can lead to the wrong order of the completion of timeout_list. Fix it by reuse req->submit.sequence to store the count, and change the logic of inserting sort in io_timeout. Signed-off-by: yangerkun <yangerkun@huawei.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-cgroup.c')
0 files changed, 0 insertions, 0 deletions