From: Greg KH <gregkh@linuxfoundation.org>
To: FUJITA Tomonori <tomo@aliasing.net>
Cc: adarshdas950@gmail.com, ojeda@kernel.org, boqun@kernel.org,
gary@garyguo.net, bjorn3_gh@protonmail.com, lossin@kernel.org,
a.hindborg@kernel.org, aliceryhl@google.com, tmgross@umich.edu,
dakr@kernel.org, rust-for-linux@vger.kernel.org
Subject: Re: [PATCH 4/4] rust: time: add `pr_warn_once!` for clamped delta in `fsleep`
Date: Thu, 26 Feb 2026 06:36:47 -0800 [thread overview]
Message-ID: <2026022602-audition-utopia-f7b9@gregkh> (raw)
In-Reply-To: <20260226.215923.1020202093931415612.fujita@bee>
On Thu, Feb 26, 2026 at 09:59:23PM +0900, FUJITA Tomonori wrote:
> On Thu, 26 Feb 2026 17:38:48 +0530
> Adarsh Das <adarshdas950@gmail.com> wrote:
>
> > Add a warning when the delta is clamped to the maximum value and remove the TODO comment.
> >
> > Signed-off-by: Adarsh Das <adarshdas950@gmail.com>
> > ---
> > rust/kernel/time/delay.rs | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/rust/kernel/time/delay.rs b/rust/kernel/time/delay.rs
> > index b5b1b42797a0..0965fcb6eb80 100644
> > --- a/rust/kernel/time/delay.rs
> > +++ b/rust/kernel/time/delay.rs
> > @@ -35,7 +35,7 @@ pub fn fsleep(delta: Delta) {
> > let delta = if (Delta::ZERO..=MAX_DELTA).contains(&delta) {
> > delta
> > } else {
> > - // TODO: Add WARN_ONCE() when it's supported.
> > + crate::pr_warn_once!("delta out of range, clamping to maximum\n");
> > MAX_DELTA
> > };
>
> pr_warn_once() and WARN_ONCE() are different; WARN_ONCE() also dumps a
> stack trace, which is more appropriate here, I think.
WARN_ONCE() also will panic the machine if panic_on_warn is enabled. As
it is done in a few billion Linux systems right now :(
So be very careful about that.
thanks,
greg k-h
prev parent reply other threads:[~2026-02-26 14:36 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 ` [PATCH 3/4] rust: mm: add `pr_warn_once!` for invalid range in `zap_page_range_single` Adarsh Das
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 [this message]
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=2026022602-audition-utopia-f7b9@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=a.hindborg@kernel.org \
--cc=adarshdas950@gmail.com \
--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 \
--cc=tomo@aliasing.net \
/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