]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: kbuf: fix bug of not consuming ring buffer in partial io case
authorHao Xu <howeyxu@tencent.com>
Sat, 11 Jun 2022 12:29:52 +0000 (20:29 +0800)
committerPavel Begunkov <asml.silence@gmail.com>
Mon, 13 Jun 2022 10:37:30 +0000 (11:37 +0100)
commitb1e4cc69e03632fa6bdfde7d03289d61408063b4
treec81732f558477373928948e3b7fe7daee5217753
parent6681b1b2e136097694df933489232bbc4af3d20d
io_uring: kbuf: fix bug of not consuming ring buffer in partial io case

When we use ring-mapped provided buffer, we should consume it before
arm poll if partial io has been done. Otherwise the buffer may be used
by other requests and thus we lost the data.

Fixes: e790404d1245 ("io_uring: add support for ring mapped supplied buffers")
Signed-off-by: Hao Xu <howeyxu@tencent.com>
[pavel: 5.19 rebase]
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
fs/io_uring.c