Blob Blame History Raw
From b60cac14bb3c88cff2a7088d9095b01a80938c41 Mon Sep 17 00:00:00 2001
From: Jens Axboe <axboe@kernel.dk>
Date: Tue, 21 Jun 2022 07:47:13 -0600
Subject: [PATCH] io_uring: fix merge error in checking send/recv addr2 flags
Git-commit: b60cac14bb3c88cff2a7088d9095b01a80938c41
Patch-mainline: v5.19-rc4
References: bsc#1205205

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>
Signed-off-by: Gabriel Krisman Bertazi <krisman@suse.de>
---
 fs/io_uring.c |    2 --
 1 file changed, 2 deletions(-)

--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -6015,8 +6015,6 @@ static int io_recvmsg_prep(struct io_kio
 
 	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);