lkml.org 
[lkml]   [2013]   [May]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2] init: Do not warn on non-zero initcall return
From
On Wed, May 1, 2013 at 7:35 PM, Steven Rostedt <rostedt@goodmis.org> wrote:
> Commit f91eb62f71 "init: scream bloody murder if interrupts are enabled
> too early" added three new warnings. The first two seemed reasonable,
> but the third included a warning when an initcall returned non-zero.
> Although, the third WARN() does include an imbalanced preempt disabled,
> or irqs disable, it shouldn't warn if it only had an initcall that just
> returns non-zero.
>
> In fact, according to Linus, it shouldn't print at all. As it only
> prints with initcall_debug set, and that already shows enough
> information to fix things.
>
> Link: http://lkml.kernel.org/r/CA+55aFzaBC5SFi7=F2mfm+KWY5qTsBmOqgbbs8E+LUS8JK-sBg@mail.gmail.com
>
> Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
> Reported-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
>
> diff --git a/init/main.c b/init/main.c
> index bea1287..ceed17a 100644
> --- a/init/main.c
> +++ b/init/main.c
> @@ -686,11 +686,8 @@ int __init_or_module do_one_initcall(initcall_t fn)
>
> msgbuf[0] = 0;
>
> - if (ret && ret != -ENODEV && initcall_debug)
> - sprintf(msgbuf, "error code %d ", ret);
> -
> if (preempt_count() != count) {
> - strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf));
> + sprintf(msgbuf, "preemption imbalance ");

snprintf(), please?

JFYI, the v3.9 version already used up all of msgbuf[] in the
worst-case scenario,
and it did have the strlcat() as a parachute:

$ echo -n "error code 1234567890 preemption imbalance disabled
interrupts " | wc -c
63
$

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds


\
 
 \ /
  Last update: 2013-05-02 10:41    [W:0.056 / U:0.540 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site