Let's not crash if BUG triggered with IRQs or BHs disabled. At least, in the debug build.

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3198 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2011-01-06 18:29:17 +00:00
parent ff8b7ea523
commit 7bf6429246

View File

@@ -34,20 +34,22 @@
#if !defined(INSIDE_KERNEL_TREE)
#ifdef CONFIG_SCST_DEBUG
#ifndef CONFIG_DEBUG_BUGVERBOSE
#define sBUG() do { \
printk(KERN_CRIT "BUG at %s:%d\n", \
__FILE__, __LINE__); \
local_irq_enable(); \
while (in_softirq()) \
local_bh_enable(); \
BUG(); \
} while (0)
#else
#define sBUG() BUG()
#endif
#define sBUG_ON(p) do { \
if (unlikely(p)) { \
printk(KERN_CRIT "BUG at %s:%d (%s)\n", \
__FILE__, __LINE__, #p); \
local_irq_enable(); \
while (in_softirq()) \
local_bh_enable(); \
BUG(); \
} \
} while (0)