[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YjlNtkNP1FJ4XEyX@google.com>
Date: Tue, 22 Mar 2022 13:16:54 +0900
From: Sergey Senozhatsky <senozhatsky@...omium.org>
To: Petr Mladek <pmladek@...e.com>
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Miguel Ojeda <ojeda@...nel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org,
Gary Guo <gary@...yguo.net>,
Alex Gaynor <alex.gaynor@...il.com>,
Wedson Almeida Filho <wedsonaf@...gle.com>,
Steven Rostedt <rostedt@...dmis.org>,
Sergey Senozhatsky <senozhatsky@...omium.org>,
Rasmus Villemoes <linux@...musvillemoes.dk>
Subject: Re: [PATCH v5 12/20] vsprintf: add new `%pA` format specifier
On (22/03/18 17:04), Petr Mladek wrote:
> On Fri 2022-03-18 16:07:31, Andy Shevchenko wrote:
> > On Thu, Mar 17, 2022 at 07:10:00PM +0100, Miguel Ojeda wrote:
> > > From: Gary Guo <gary@...yguo.net>
> > > + case 'A':
> > > + if (!IS_ENABLED(CONFIG_RUST)) {
> > > + WARN_ONCE(1, "Please remove %%pA from non-Rust code\n");
> > > + return error_string(buf, end, "(%pA?)", spec);
> > > + }
> >
> > I'm wondering if the Big Scary Banner as trace_printk() does would be better
> > (in case we can tell that %pA is used in the code when RUST=n).
>
> Good question!
>
> The advantage of WARN_ONCE() is that it shows the stack so that it is
> easier to locate the caller.
>
> On the other hand, WARN_ONCE() is a bit misused here. It should be
> used only in situations that might be potentially fatal. It might
> even cause panic() with "panic_on_warn" kernel parameter.
Stack trace is certainly helpful here. So maybe dump_stack() instead
of WARN_ONCE()? I guess I don't mind WARN_ONCE().
Powered by blists - more mailing lists