]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: fix the sequence comparison in io_sequence_defer
authorZhengyuan Liu <liuzhengyuan@kylinos.cn>
Sat, 13 Jul 2019 03:58:26 +0000 (11:58 +0800)
committerJens Axboe <axboe@kernel.dk>
Tue, 16 Jul 2019 14:27:09 +0000 (08:27 -0600)
commit633e397def8703bc25f8e8287c541807e1061e53
treebf49250d4c59d6b4ed45b9075cf9c3d793872064
parent5bd82cc71c33e015410ac72676fd5ae115a8a2ab
io_uring: fix the sequence comparison in io_sequence_defer

sq->cached_sq_head and cq->cached_cq_tail are both unsigned int. If
cached_sq_head overflows before cached_cq_tail, then we may miss a
barrier req. As cached_cq_tail always follows cached_sq_head, the NQ
should be enough.

Cc: stable@vger.kernel.org
Fixes: bc80a87477c8 ("io_uring: add support for marking commands as draining")
Signed-off-by: Zhengyuan Liu <liuzhengyuan@kylinos.cn>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c