From: clingfei <clf700383@gmail.com>
To: axboe@kernel.dk
Cc: io-uring@vger.kernel.org, linux-kernel@vger.kernel.org,
clingfei <clf700383@gmail.com>
Subject: [PATCH] io_uring/rsrc: remove unnecessary check on resv2
Date: Tue, 23 Sep 2025 16:41:11 +0800 [thread overview]
Message-ID: <CADPKJ-7cb9fcPbP3gDNauc22nSbqmddhYzmKeVSiLpkc_u88KA@mail.gmail.com> (raw)
From b52509776e0f7f9ea703d0551ccaeeaa49ab6440 Mon Sep 17 00:00:00 2001
From: clingfei <clf700383@gmail.com>
Date: Tue, 23 Sep 2025 16:30:30 +0800
Subject: [PATCH] io_uring/rsrc: remove unnecessary check on resv2
The memset sets the up.resv2 to be 0,
and the copy_from_user does not touch it,
thus up.resv2 will always be false.
Signed-off-by: clingfei <clf700383@gmail.com>
---
io_uring/rsrc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/io_uring/rsrc.c b/io_uring/rsrc.c
index f75f5e43fa4a..7006b3ca5404 100644
--- a/io_uring/rsrc.c
+++ b/io_uring/rsrc.c
@@ -372,7 +372,7 @@ int io_register_files_update(struct io_ring_ctx
*ctx, void __user *arg,
memset(&up, 0, sizeof(up));
if (copy_from_user(&up, arg, sizeof(struct io_uring_rsrc_update)))
return -EFAULT;
- if (up.resv || up.resv2)
+ if (up.resv)
return -EINVAL;
return __io_register_rsrc_update(ctx, IORING_RSRC_FILE, &up, nr_args);
}
--
2.34.1
next reply other threads:[~2025-09-23 8:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-23 8:41 clingfei [this message]
2025-09-23 8:50 ` [PATCH] io_uring/rsrc: remove unnecessary check on resv2 Jens Axboe
2025-09-23 9:10 ` clingfei
2025-09-23 11:25 ` Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CADPKJ-7cb9fcPbP3gDNauc22nSbqmddhYzmKeVSiLpkc_u88KA@mail.gmail.com \
--to=clf700383@gmail.com \
--cc=axboe@kernel.dk \
--cc=io-uring@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox