Skip to content

Commit

Permalink
handle recursive calls to bust_spinlocks()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Jan Beulich authored and Linus Torvalds committed Oct 17, 2007
1 parent b311e92 commit 0044299
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/bust_spinlocks.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

Expand Down

0 comments on commit 0044299

Please sign in to comment.