]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
io_uring/net: remove unnecessary REQ_F_NEED_CLEANUP
authorPavel Begunkov <asml.silence@gmail.com>
Wed, 26 Feb 2025 11:41:15 +0000 (11:41 +0000)
committerJens Axboe <axboe@kernel.dk>
Thu, 27 Feb 2025 14:19:01 +0000 (07:19 -0700)
REQ_F_NEED_CLEANUP in io_recvmsg_prep_setup() and in io_sendmsg_setup()
are relics of the past and don't do anything useful, the flag should be
and are set earlier on iovec and async_data allocation.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/6aedc3141c1fc027128a4503656cfd686a6980ef.1740569495.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/net.c

index bce75d64be9227ef5ccc36b241713a50df019c90..c78edfd5085ee545df096c613ec82344d14087d1 100644 (file)
@@ -388,14 +388,10 @@ static int io_sendmsg_setup(struct io_kiocb *req, const struct io_uring_sqe *sqe
 {
        struct io_sr_msg *sr = io_kiocb_to_cmd(req, struct io_sr_msg);
        struct io_async_msghdr *kmsg = req->async_data;
-       int ret;
 
        sr->umsg = u64_to_user_ptr(READ_ONCE(sqe->addr));
 
-       ret = io_sendmsg_copy_hdr(req, kmsg);
-       if (!ret)
-               req->flags |= REQ_F_NEED_CLEANUP;
-       return ret;
+       return io_sendmsg_copy_hdr(req, kmsg);
 }
 
 #define SENDMSG_FLAGS (IORING_RECVSEND_POLL_FIRST | IORING_RECVSEND_BUNDLE)
@@ -774,10 +770,7 @@ static int io_recvmsg_prep_setup(struct io_kiocb *req)
                return 0;
        }
 
-       ret = io_recvmsg_copy_hdr(req, kmsg);
-       if (!ret)
-               req->flags |= REQ_F_NEED_CLEANUP;
-       return ret;
+       return io_recvmsg_copy_hdr(req, kmsg);
 }
 
 #define RECVMSG_FLAGS (IORING_RECVSEND_POLL_FIRST | IORING_RECV_MULTISHOT | \