]> 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)
commitc52932785832024db9de95e660174fc2fb3c82fe
treec81732f558477373928948e3b7fe7daee5217753
parent02f692faf73008784fbb73f0cd25eb533653e41b
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: 0bf3e064f36c ("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