diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2015-02-10 14:35:36 -0500 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2015-02-10 14:35:36 -0500 |
| commit | 4ba24fef3eb3b142197135223b90ced2f319cd53 (patch) | |
| tree | a20c125b27740ec7b4c761b11d801108e1b316b2 /kernel/panic.c | |
| parent | 47c1ffb2b6b630894e9a16442611c056ab21c057 (diff) | |
| parent | 98a4a59ee31a12105a2b84f5b8b515ac2cb208ef (diff) | |
Merge branch 'next' into for-linus
Prepare first round of input updates for 3.20.
Diffstat (limited to 'kernel/panic.c')
| -rw-r--r-- | kernel/panic.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/kernel/panic.c b/kernel/panic.c index d09dc5c32c67..4d8d6f906dec 100644 --- a/kernel/panic.c +++ b/kernel/panic.c | |||
| @@ -33,6 +33,7 @@ static int pause_on_oops; | |||
| 33 | static int pause_on_oops_flag; | 33 | static int pause_on_oops_flag; |
| 34 | static DEFINE_SPINLOCK(pause_on_oops_lock); | 34 | static DEFINE_SPINLOCK(pause_on_oops_lock); |
| 35 | static bool crash_kexec_post_notifiers; | 35 | static bool crash_kexec_post_notifiers; |
| 36 | int panic_on_warn __read_mostly; | ||
| 36 | 37 | ||
| 37 | int panic_timeout = CONFIG_PANIC_TIMEOUT; | 38 | int panic_timeout = CONFIG_PANIC_TIMEOUT; |
| 38 | EXPORT_SYMBOL_GPL(panic_timeout); | 39 | EXPORT_SYMBOL_GPL(panic_timeout); |
| @@ -244,6 +245,7 @@ static const struct tnt tnts[] = { | |||
| 244 | * 'I' - Working around severe firmware bug. | 245 | * 'I' - Working around severe firmware bug. |
| 245 | * 'O' - Out-of-tree module has been loaded. | 246 | * 'O' - Out-of-tree module has been loaded. |
| 246 | * 'E' - Unsigned module has been loaded. | 247 | * 'E' - Unsigned module has been loaded. |
| 248 | * 'L' - A soft lockup has previously occurred. | ||
| 247 | * | 249 | * |
| 248 | * The string is overwritten by the next call to print_tainted(). | 250 | * The string is overwritten by the next call to print_tainted(). |
| 249 | */ | 251 | */ |
| @@ -427,6 +429,17 @@ static void warn_slowpath_common(const char *file, int line, void *caller, | |||
| 427 | if (args) | 429 | if (args) |
| 428 | vprintk(args->fmt, args->args); | 430 | vprintk(args->fmt, args->args); |
| 429 | 431 | ||
| 432 | if (panic_on_warn) { | ||
| 433 | /* | ||
| 434 | * This thread may hit another WARN() in the panic path. | ||
| 435 | * Resetting this prevents additional WARN() from panicking the | ||
| 436 | * system on this thread. Other threads are blocked by the | ||
| 437 | * panic_mutex in panic(). | ||
| 438 | */ | ||
| 439 | panic_on_warn = 0; | ||
| 440 | panic("panic_on_warn set ...\n"); | ||
| 441 | } | ||
| 442 | |||
| 430 | print_modules(); | 443 | print_modules(); |
| 431 | dump_stack(); | 444 | dump_stack(); |
| 432 | print_oops_end_marker(); | 445 | print_oops_end_marker(); |
| @@ -484,6 +497,7 @@ EXPORT_SYMBOL(__stack_chk_fail); | |||
| 484 | 497 | ||
| 485 | core_param(panic, panic_timeout, int, 0644); | 498 | core_param(panic, panic_timeout, int, 0644); |
| 486 | core_param(pause_on_oops, pause_on_oops, int, 0644); | 499 | core_param(pause_on_oops, pause_on_oops, int, 0644); |
| 500 | core_param(panic_on_warn, panic_on_warn, int, 0644); | ||
| 487 | 501 | ||
| 488 | static int __init setup_crash_kexec_post_notifiers(char *s) | 502 | static int __init setup_crash_kexec_post_notifiers(char *s) |
| 489 | { | 503 | { |
