Re: [PATCH] Fix generic WARN_ON message

From: Nick Piggin
Date: Wed Oct 18 2006 - 14:40:53 EST


Jeremy Fitzhardinge wrote:
Ingo Molnar wrote:

Firstly, most WARN_ON()s are /bugs/, not warnings ... If it's a real warning, a KERN_INFO printk should be done.


It seems to me that either the warnings are really bugs, in which case they should be using BUG/BUG_ON, or they're not really bugs, in which case they should be presented differently.

No. A BUG() will terminate the current process which, aside from the
loss of userspace data, can tangle up the kernel badly and deadlock
or panic it.

If a bug can be fixed up or otherwise will not result in unstable
behaviour with continued operation, then it should be a WARN.


Secondly, the reason i changed it to the 'BUG: ...' format is that i tried to make it easier for automated tools (and for users) to figure out that a kernel bug happened.


Well, are they bugs or not? I think people are more confused by the "BUG" prefix and stacktrace than helped by it (even an experienced eye will glance-parse a BUG+stack trace as a serious oops-level problem rather than a warning).

Definitely a bug. If the condition is not a bug then the code calling
WARN is, so it is a bug no matter how you look at it ;)

--
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com -
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/