[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1367507873.30667.136.camel@gandalf.local.home>
Date: Thu, 02 May 2013 11:17:53 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
LKML <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
Subject: Re: [PATCH v2] init: Do not warn on non-zero initcall return
On Thu, 2013-05-02 at 09:43 +0200, Geert Uytterhoeven wrote:
> On Wed, May 1, 2013 at 7:35 PM, Steven Rostedt <rostedt@...dmis.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@...ux-foundation.org>
> > Reported-by: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
> > Signed-off-by: Steven Rostedt <rostedt@...dmis.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?
Why? The msgbuf is 64 bytes, this is the first occurrence and
"preemption imbalance " is much less than 64 bytes.
>
> 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:
Right, the other users had strlcat as they were not the first user and
add onto the string.
-- Steve
>
> $ echo -n "error code 1234567890 preemption imbalance disabled
> interrupts " | wc -c
> 63
> $
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists