From e2cddd104051ee3f47dddaa0b8d54a5193f0971b Mon Sep 17 00:00:00 2001 From: Syed Rameez Mustafa Date: Mon, 15 Jul 2013 11:52:09 -0700 Subject: kernel/lib: add additional debug capabilites for data corruption Data corruptions in the kernel often end up in system crashes that are easier to debug closer to the time of detection. Specifically, if we do not panic immediately after lock or list corruptions have been detected, the problem context is lost in the ensuing system mayhem. Add support for allowing system crash immediately after such corruptions are detected. The CONFIG option controls the enabling/disabling of the feature. Change-Id: I9b2eb62da506a13007acff63e85e9515145909ff Signed-off-by: Syed Rameez Mustafa [abhimany: minor merge conflict resolution] Signed-off-by: Abhimanyu Kapur --- kernel/locking/spinlock_debug.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'kernel/locking') diff --git a/kernel/locking/spinlock_debug.c b/kernel/locking/spinlock_debug.c index 0374a596cffa..6011c190e2b1 100644 --- a/kernel/locking/spinlock_debug.c +++ b/kernel/locking/spinlock_debug.c @@ -12,6 +12,7 @@ #include #include #include +#include void __raw_spin_lock_init(raw_spinlock_t *lock, const char *name, struct lock_class_key *key) @@ -64,6 +65,7 @@ static void spin_dump(raw_spinlock_t *lock, const char *msg) owner ? owner->comm : "", owner ? task_pid_nr(owner) : -1, lock->owner_cpu); + BUG_ON(PANIC_CORRUPTION); dump_stack(); } -- cgit v1.2.3