From: Yilin Chen <1479826151@qq.com>
To: Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
rust-for-linux@vger.kernel.org
Cc: Miguel Ojeda <ojeda@kernel.org>,
linux-kernel@vger.kernel.org, Yilin Chen <1479826151@qq.com>
Subject: [PATCH] rust: miscdevice: fix write_iter safety docs
Date: Tue, 7 Jul 2026 16:10:30 +0000 [thread overview]
Message-ID: <tencent_8CD671E0F35223030143524D045F3BCAD506@qq.com> (raw)
The write_iter callback consumes data from the supplied iov_iter and
wraps it as an IovIterSource.
Its Safety docs required a valid iov_iter for writing, but the
implementation and the IovIterSource contract require one that is valid
for reading. Update the docs to match that direction.
Assisted-by: Codex:GPT-5
Signed-off-by: Yilin Chen <1479826151@qq.com>
---
rust/kernel/miscdevice.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rust/kernel/miscdevice.rs b/rust/kernel/miscdevice.rs
index 83ce50def..3abef1b85 100644
--- a/rust/kernel/miscdevice.rs
+++ b/rust/kernel/miscdevice.rs
@@ -289,7 +289,7 @@ impl<T: MiscDevice> MiscdeviceVTable<T> {
/// # Safety
///
/// `kiocb` must be correspond to a valid file that is associated with a
- /// `MiscDeviceRegistration<T>`. `iter` must be a valid `struct iov_iter` for writing.
+ /// `MiscDeviceRegistration<T>`. `iter` must be a valid `struct iov_iter` for reading.
unsafe extern "C" fn write_iter(
kiocb: *mut bindings::kiocb,
iter: *mut bindings::iov_iter,
--
2.25.1
reply other threads:[~2026-07-07 16:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=tencent_8CD671E0F35223030143524D045F3BCAD506@qq.com \
--to=1479826151@qq.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@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