lkml.org 
[lkml]   [2022]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Introduce the pkill_on_warn boot parameter
From
Date
On 27.07.2022 19:42, Linus Torvalds wrote:
> On Wed, Jul 27, 2022 at 9:17 AM Alexey Khoroshilov
> <khoroshilov@ispras.ru> wrote:
>>
>> We see a number of cases where WARNING is used to inform userspace that
>> it is doing something wrong, e.g.
>> https://elixir.bootlin.com/linux/v5.19-rc8/source/net/can/j1939/socket.c#L181
>> https://elixir.bootlin.com/linux/v5.19-rc8/source/drivers/video/fbdev/core/fbmem.c#L1023
>
> That first case is entirely bogus.
>
> WARN_ON() should only be used for "This cannot happen, but if it does,
> I want to know how we got here".
>
> But the second case is fine: Using "pr_warn()" is fine. A kernel
> warning (without a backtrace) is a normal thing for something that is
> deprecated or questionable, and you want to tell the user that "this
> app is doing something wrong".

Agree with the only note that I like the requirement:

* Do not include "BUG"/"WARNING" in format strings manually to make
* these conditions distinguishable from kernel issues.

very much.

Thank you,
Alexey

\
 
 \ /
  Last update: 2022-07-27 20:53    [W:0.077 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site