Warning about WARN_ON()
Warning about WARN_ON()
Posted Apr 18, 2024 15:22 UTC (Thu) by mfuzzey (subscriber, #57966)Parent article: Warning about WARN_ON()
The nice (from a developpers point of view) thing about WARN_ON is that gives a stack trace which can be helpful in understanding why the situation occured which dev_warn() and pr_warn() don't do. The stack trace is also "noisier" which seems to help getting the problem reported.
Maybe WARN_ON_NEVER_PANIC() or WARN_ON_MAY_PANIC() ?
But the reasoning for avoiding WARN_ON() related to the panic_on_warn option seems very strange to me.
If the system administrator / device manufacturer decides that rebooting on a warning is important to them that's their perogative right?
If people stop using WARN_ON() then panic_on_warn becomes pointless and the said administrators lose whatever they thought they were gaining by panic_on_warn.