projects/linux·commit aa184e86

io_uring: don't attempt to IOPOLL for MSG_RING requests

aa184e86 · Jens Axboe <[email protected]> · 2022-05-17 12:32:05 -06:00

We gate whether to IOPOLL for a request on whether the opcode is allowed
on a ring setup for IOPOLL and if it's got a file assigned. MSG_RING
is the only one that allows a file yet isn't pollable, it's merely
supported to allow communication on an IOPOLL ring, not because we can
poll for completion of it.

Put the assigned file early and clear it, so we don't attempt to poll
for it.

Reported-by: [email protected]
Fixes: 3f1d52abf098 ("io_uring: defer msg-ring file validity check until command issue")
Signed-off-by: Jens Axboe <[email protected]>
Commit
aa184e8671f0f911fc2fb3f68cd506e4d7838faa
Parents
2d2d5cb6

Changes

1 files changed · +3 −0

FileStatusAddDelContent
fs/io_uring.cmodified+3−0View file

fs/io_uring.c

View file
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 91de361..e0823f5 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -4481,6 +4481,9 @@ done:
if (ret < 0)
req_set_fail(req);
__io_req_complete(req, issue_flags, ret, 0);
+ /* put file to avoid an attempt to IOPOLL the req */
+ io_put_file(req->file);
+ req->file = NULL;
return 0;
}