]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
io_uring/rw: clean up __io_read() obsolete comment and early returns
authorJoanne Koong <joannelkoong@gmail.com>
Wed, 1 Apr 2026 17:35:11 +0000 (10:35 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 2 Apr 2026 12:55:50 +0000 (06:55 -0600)
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 <joannelkoong@gmail.com>
Link: https://patch.msgid.link/20260401173511.4052303-1-joannelkoong@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/rw.c

index 046f76a71b9c187d897dcbe5d82dc848f54101aa..20654deff84de4b045716f81c55222e1d82ba7a0 100644 (file)
@@ -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;
 }