io_uring: fix mshot read defer taskrun cqe posting

[ Upstream commit 70581dcd06 ]

We can't post CQEs from io-wq with DEFER_TASKRUN set, normal completions
are handled but aux should be explicitly disallowed by opcode handlers.

Cc: stable@vger.kernel.org
Fixes: fc68fcda04 ("io_uring/rw: add support for IORING_OP_READ_MULTISHOT")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/6fb7cba6f5366da25f4d3eb95273f062309d97fa.1709740837.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Pavel Begunkov 2024-03-06 16:02:25 +00:00 committed by Greg Kroah-Hartman
parent 6afa86eb39
commit d6b6e94e11
1 changed files with 2 additions and 0 deletions

View File

@ -932,6 +932,8 @@ int io_read_mshot(struct io_kiocb *req, unsigned int issue_flags)
*/
if (!file_can_poll(req->file))
return -EBADFD;
if (issue_flags & IO_URING_F_IOWQ)
return -EAGAIN;
ret = __io_read(req, issue_flags);