Skip to content

Commit 336d28a

Browse files
isilenceaxboe
authored andcommitted
io_uring: recycle kbuf recycle on tw requeue
When we queue a request via tw for execution it's not going to be executed immediately, so when io_queue_async() hits IO_APOLL_READY and queues a tw but doesn't try to recycle/consume the buffer some other request may try to use the the buffer. Fixes: c7fb194 ("io_uring: add support for ring mapped supplied buffers") Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/a19bc9e211e3184215a58e129b62f440180e9212.1662480490.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent df6d342 commit 336d28a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

io_uring/io_uring.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1728,6 +1728,7 @@ static void io_queue_async(struct io_kiocb *req, int ret)
17281728

17291729
switch (io_arm_poll_handler(req, 0)) {
17301730
case IO_APOLL_READY:
1731+
io_kbuf_recycle(req, 0);
17311732
io_req_task_queue(req);
17321733
break;
17331734
case IO_APOLL_ABORTED:

0 commit comments

Comments
 (0)