Skip to contentSkip to conversation

io_uring/rw: return IOU_ISSUE_SKIP_COMPLETE for multishot retry

PATCH New Jens Axboe 1 participant 1 message Mar 12, 2024 io_uring

lore
Share & tools
lore

Jens Axboe

author maintainer
#0 lore raw

PATCH 1/1 io_uring/rw: return IOU_ISSUE_SKIP_COMPLETE for multishot retry

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.

Fixes fc68fcda04910 ("io_uring/rw: add support for IORING_OP_READ_MULTISHOT")

---

io_uring/rw.c +2 -0
index 47e097ab5d7e..0585ebcc9773 100644
@@ -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;
 	}
 
Signature · 1 line
Jens Axboe