]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: recycle provided buffer if we punt to io-wq
authorJens Axboe <axboe@kernel.dk>
Fri, 17 Jun 2022 12:24:26 +0000 (06:24 -0600)
committerJens Axboe <axboe@kernel.dk>
Fri, 17 Jun 2022 12:24:26 +0000 (06:24 -0600)
commit642e08d79923352d4e91e055d24e46598a82359a
treec1130ff61dfa4a81d56d2309a8a5c101d0f6bd3c
parent8c6f063f45d917309c4f19155bbc7ec4ce5ff1a5
io_uring: recycle provided buffer if we punt to io-wq

io_arm_poll_handler() will recycle the buffer appropriately if we end
up arming poll (or if we're ready to retry), but not for the io-wq case
if we have attempted poll first.

Explicitly recycle the buffer to avoid both hanging on to it too long,
but also to avoid multiple reads grabbing the same one. This can happen
for ring mapped buffers, since it hasn't necessarily been committed.

Fixes: 0bf3e064f36c ("io_uring: add support for ring mapped supplied buffers")
Link: https://github.com/axboe/liburing/issues/605
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c