From: Joanne Koong Date: Wed, 1 Apr 2026 17:35:11 +0000 (-0700) Subject: io_uring/rw: clean up __io_read() obsolete comment and early returns X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c7f3aaf3e835f2dc0f3f293ae3739b844b909595;p=thirdparty%2Flinux.git io_uring/rw: clean up __io_read() obsolete comment and early returns After commit a9165b83c193 ("io_uring/rw: always setup io_async_rw for read/write requests") which moved the iovec allocation into the prep path and stores it in req->async_data where it now gets freed as part of the request lifecycle, this comment is now outdated. Remove it and clean up the goto as well. Signed-off-by: Joanne Koong Link: https://patch.msgid.link/20260401173511.4052303-1-joannelkoong@gmail.com Signed-off-by: Jens Axboe --- diff --git a/io_uring/rw.c b/io_uring/rw.c index 046f76a71b9c1..20654deff84de 100644 --- a/io_uring/rw.c +++ b/io_uring/rw.c @@ -962,13 +962,13 @@ static int __io_read(struct io_kiocb *req, struct io_br_sel *sel, if (ret == -EAGAIN) { /* If we can poll, just do that. */ if (io_file_can_poll(req)) - return -EAGAIN; + return ret; /* IOPOLL retry should happen for io-wq threads */ if (!force_nonblock && !(req->flags & REQ_F_IOPOLL)) - goto done; + return ret; /* no retry on NONBLOCK nor RWF_NOWAIT */ if (req->flags & REQ_F_NOWAIT) - goto done; + return ret; ret = 0; } else if (ret == -EIOCBQUEUED) { return IOU_ISSUE_SKIP_COMPLETE; @@ -976,7 +976,7 @@ static int __io_read(struct io_kiocb *req, struct io_br_sel *sel, (req->flags & REQ_F_NOWAIT) || !need_complete_io(req) || (issue_flags & IO_URING_F_MULTISHOT)) { /* read all, failed, already did sync or don't want to retry */ - goto done; + return ret; } /* @@ -1019,8 +1019,7 @@ static int __io_read(struct io_kiocb *req, struct io_br_sel *sel, kiocb->ki_flags &= ~IOCB_WAITQ; iov_iter_restore(&io->iter, &io->iter_state); } while (ret > 0); -done: - /* it's faster to check here than delegate to kfree */ + return ret; }