Skip to content

Commit b532576

Browse files
committed
io_uring: don't add non-IO requests to iopoll pending list
We normally disable any commands that aren't specifically poll commands for a ring that is setup for polling, but we do allow buffer provide and remove commands to support buffer selection for polled IO. Once a request is issued, we add it to the poll list to poll for completion. But we should not do that for non-IO commands, as those request complete inline immediately and aren't pollable. If we do, we can leave requests on the iopoll list after they are freed. Fixes: ddf0322 ("io_uring: add IORING_OP_PROVIDE_BUFFERS") Signed-off-by: Jens Axboe <[email protected]>
1 parent 4f4eeba commit b532576

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/io_uring.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5306,7 +5306,8 @@ static int io_issue_sqe(struct io_kiocb *req, const struct io_uring_sqe *sqe,
53065306
if (ret)
53075307
return ret;
53085308

5309-
if (ctx->flags & IORING_SETUP_IOPOLL) {
5309+
/* If the op doesn't have a file, we're not polling for it */
5310+
if ((ctx->flags & IORING_SETUP_IOPOLL) && req->file) {
53105311
const bool in_async = io_wq_current_is_worker();
53115312

53125313
if (req->result == -EAGAIN)

0 commit comments

Comments
 (0)