public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Adarsh Das <adarshdas950@gmail.com>
To: Miguel Ojeda <ojeda@kernel.org>
Cc: "Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	rust-for-linux@vger.kernel.org,
	"Adarsh Das" <adarshdas950@gmail.com>
Subject: [PATCH 3/4] rust: mm: add `pr_warn_once!` for invalid range in `zap_page_range_single`
Date: Thu, 26 Feb 2026 17:38:47 +0530	[thread overview]
Message-ID: <20260226120848.82891-4-adarshdas950@gmail.com> (raw)
In-Reply-To: <20260226120848.82891-1-adarshdas950@gmail.com>

Add a warning for the invalid range case and remove the TODO comment.

Signed-off-by: Adarsh Das <adarshdas950@gmail.com>
---
 rust/kernel/mm/virt.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rust/kernel/mm/virt.rs b/rust/kernel/mm/virt.rs
index da21d65ccd20..f608262a4ff8 100644
--- a/rust/kernel/mm/virt.rs
+++ b/rust/kernel/mm/virt.rs
@@ -116,7 +116,7 @@ pub fn end(&self) -> usize {
     pub fn zap_page_range_single(&self, address: usize, size: usize) {
         let (end, did_overflow) = address.overflowing_add(size);
         if did_overflow || address < self.start() || self.end() < end {
-            // TODO: call WARN_ONCE once Rust version of it is added
+            crate::pr_warn_once!("VMA contains invalid range\n");
             return;
         }
 
-- 
2.53.0


  parent reply	other threads:[~2026-02-26 12:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-26 12:08 [PATCH 0/4] rust: replace WARN_ONCE TODOs with pr_warn_once! Adarsh Das
2026-02-26 12:08 ` [PATCH 1/4] rust: error: use `pr_warn_once!` instead of `pr_warn!` Adarsh Das
2026-02-26 12:08 ` [PATCH 2/4] rust: module_params: " Adarsh Das
2026-02-26 12:08 ` Adarsh Das [this message]
2026-02-26 12:08 ` [PATCH 4/4] rust: time: add `pr_warn_once!` for clamped delta in `fsleep` Adarsh Das
2026-02-26 12:59   ` FUJITA Tomonori
2026-02-26 14:18     ` Gary Guo
2026-02-26 14:36     ` Greg KH

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=20260226120848.82891-4-adarshdas950@gmail.com \
    --to=adarshdas950@gmail.com \
    --cc=a.hindborg@kernel.org \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=lossin@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    /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