summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2007-10-17 08:29:33 +0200
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-17 17:42:56 +0200
commit004429956b4875e6bc2a31833f75363ce48cbea9 (patch)
treeb137a191e02dd086a7c9aaa41fb88b7bdd362ce4 /lib
parentAdd a "rounddown_pow_of_two" routine to log2.h (diff)
downloadlinux-004429956b4875e6bc2a31833f75363ce48cbea9.tar.xz
linux-004429956b4875e6bc2a31833f75363ce48cbea9.zip
handle recursive calls to bust_spinlocks()
Various architectures may call bust_spinlocks() recursively; the function itself, however, doesn't appear to be meant to be called in this manner. Nevertheless, this doesn't appear to be a problem as long as bust_spinlocks(0) doesn't get called twice in a row (otherwise, unblank_screen() may enter the scheduler). However, at least on i386 die() has been capable of returning (and on other architectures this should really be that way, too) when notify_die() returns NOTIFY_STOP. Short of getting a reply to a respective query, this patch makes bust_spinlocks() increment/decrement oops_in_progress, and wake klogd only when the count drops back to zero. Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/bust_spinlocks.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/bust_spinlocks.c b/lib/bust_spinlocks.c
index accb35658169..486da62b2b07 100644
--- a/lib/bust_spinlocks.c
+++ b/lib/bust_spinlocks.c
@@ -17,13 +17,13 @@
void __attribute__((weak)) bust_spinlocks(int yes)
{
if (yes) {
- oops_in_progress = 1;
+ ++oops_in_progress;
} else {
#ifdef CONFIG_VT
unblank_screen();
#endif
- oops_in_progress = 0;
- wake_up_klogd();
+ if (--oops_in_progress == 0)
+ wake_up_klogd();
}
}