Skip to content

Commit 6436c77

Browse files
committed
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: c7fb194 ("io_uring: add support for ring mapped supplied buffers") Link: axboe/liburing#605 Signed-off-by: Jens Axboe <[email protected]>
1 parent 32fc810 commit 6436c77

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/io_uring.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8690,6 +8690,7 @@ static void io_queue_async(struct io_kiocb *req, int ret)
86908690
* Queued up for async execution, worker will release
86918691
* submit reference when the iocb is actually submitted.
86928692
*/
8693+
io_kbuf_recycle(req, 0);
86938694
io_queue_iowq(req, NULL);
86948695
break;
86958696
case IO_APOLL_OK:

0 commit comments

Comments
 (0)