public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org,
	Jeremy Fitzhardinge <jeremy@goop.org>
Subject: [patch] change WARN_ON back to "BUG: at ..."
Date: Thu, 21 Dec 2006 13:43:28 +0100	[thread overview]
Message-ID: <20061221124327.GA17190@elte.hu> (raw)

Subject: [patch] change WARN_ON back to "BUG: at ..."
From: Ingo Molnar <mingo@elte.hu>

WARN_ON() ever triggering is a kernel bug. Do not try to paper over this 
fact by suggesting to the user that this is 'only' a warning, as the 
following recent commit does:

  commit 30e25b71e725b150585e17888b130e3324f8cf7c
  Author: Jeremy Fitzhardinge <jeremy@goop.org>
  Date:   Fri Dec 8 02:36:24 2006 -0800

    [PATCH] Fix generic WARN_ON message

    A warning is a warning, not a BUG.

( it might make sense to rename BUG() to CRASH() and BUG_ON() to
  CRASH_ON(), but that does not change the fact that WARN_ON()
  signals a kernel bug. )

i and others objected to this change during lkml review:

  http://marc.theaimsgroup.com/?l=linux-kernel&m=116115160710533&w=2

still the change slipped upstream - grumble :)

Also, use the standard "BUG: " format to make it easier to grep logs and 
to make it easier to google for kernel bugs.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 include/asm-generic/bug.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux/include/asm-generic/bug.h
===================================================================
--- linux.orig/include/asm-generic/bug.h
+++ linux/include/asm-generic/bug.h
@@ -35,7 +35,7 @@ struct bug_entry {
 #define WARN_ON(condition) ({						\
 	typeof(condition) __ret_warn_on = (condition);			\
 	if (unlikely(__ret_warn_on)) {					\
-		printk("WARNING at %s:%d %s()\n", __FILE__,	\
+		printk("BUG: at %s:%d %s()\n", __FILE__,		\
 			__LINE__, __FUNCTION__);			\
 		dump_stack();						\
 	}								\

             reply	other threads:[~2006-12-21 12:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-21 12:43 Ingo Molnar [this message]
2006-12-21 13:00 ` [patch] change WARN_ON back to "BUG: at ..." Arjan van de Ven
2006-12-21 18:49 ` Jeremy Fitzhardinge
2006-12-21 23:57   ` Ingo Molnar
2006-12-22 20:04     ` Andrew Morton
2006-12-23  2:06       ` Steven Rostedt
2006-12-23 11:03         ` Ingo Molnar
2006-12-23 12:44           ` Steven Rostedt
2006-12-24 14:16       ` Pavel Machek
2006-12-28  9:15         ` Ingo Molnar

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=20061221124327.GA17190@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@osdl.org \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /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