Skip to content

Commit

Permalink
io_uring/rw: return IOU_ISSUE_SKIP_COMPLETE for multishot retry
Browse files Browse the repository at this point in the history
If read multishot is being invoked from the poll retry handler, then we
should return IOU_ISSUE_SKIP_COMPLETE rather than -EAGAIN. If not, then
a CQE will be posted with -EAGAIN rather than triggering the retry when
the file is flagged as readable again.

Cc: [email protected]
Reported-by: Sargun Dhillon <[email protected]>
Fixes: fc68fcd ("io_uring/rw: add support for IORING_OP_READ_MULTISHOT")
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
axboe committed Mar 12, 2024
1 parent 6f0974e commit 0a3737d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions io_uring/rw.c
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,8 @@ int io_read_mshot(struct io_kiocb *req, unsigned int issue_flags)
*/
if (io_kbuf_recycle(req, issue_flags))
rw->len = 0;
if (issue_flags & IO_URING_F_MULTISHOT)
return IOU_ISSUE_SKIP_COMPLETE;
return -EAGAIN;
}

Expand Down

0 comments on commit 0a3737d

Please sign in to comment.