io_uring: fix merge error in checking send/recv addr2 flags
authorJens Axboe <axboe@kernel.dk>
Tue, 21 Jun 2022 13:47:13 +0000 (07:47 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 21 Jun 2022 13:47:13 +0000 (07:47 -0600)
With the dropping of the IOPOLL checking in the per-opcode handlers,
we inadvertently left two checks in the recv/recvmsg and send/sendmsg
prep handlers for the same thing, and one of them includes addr2 which
holds the flags for these opcodes.

Fix it up and kill the redundant checks.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c

index 87c65a3..05508fe 100644 (file)
@@ -6077,8 +6077,6 @@ static int io_sendmsg_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
 
        if (unlikely(sqe->file_index))
                return -EINVAL;
-       if (unlikely(sqe->addr2 || sqe->file_index))
-               return -EINVAL;
 
        sr->umsg = u64_to_user_ptr(READ_ONCE(sqe->addr));
        sr->len = READ_ONCE(sqe->len);
@@ -6315,8 +6313,6 @@ static int io_recvmsg_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
 
        if (unlikely(sqe->file_index))
                return -EINVAL;
-       if (unlikely(sqe->addr2 || sqe->file_index))
-               return -EINVAL;
 
        sr->umsg = u64_to_user_ptr(READ_ONCE(sqe->addr));
        sr->len = READ_ONCE(sqe->len);