From 7bf64292466a29f6baef6120a5a5909570a33a64 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Thu, 6 Jan 2011 18:29:17 +0000 Subject: [PATCH] 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 --- scst/include/scst_debug.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scst/include/scst_debug.h b/scst/include/scst_debug.h index 0f25c656a..19150aa1f 100644 --- a/scst/include/scst_debug.h +++ b/scst/include/scst_debug.h @@ -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)