]> git.proxmox.com Git - mirror_ubuntu-kernels.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)
commit42db0c00e275877eb92480beaa16b33507dc3bda
treec81732f558477373928948e3b7fe7daee5217753
parente71d7c56dd69f720169c1675f87a1d22d8167767
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: c7fb19428d67 ("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