nfsd4: move check_stateid_generation check
[safe/jmp/linux-2.6] / kernel / panic.c
index 028013f..2a2ff36 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/debug_locks.h>
 #include <linux/random.h>
 #include <linux/kallsyms.h>
+#include <linux/dmi.h>
 
 int panic_on_oops;
 static unsigned long tainted_mask;
@@ -34,13 +35,6 @@ ATOMIC_NOTIFIER_HEAD(panic_notifier_list);
 
 EXPORT_SYMBOL(panic_notifier_list);
 
-static int __init panic_setup(char *str)
-{
-       panic_timeout = simple_strtoul(str, NULL, 0);
-       return 1;
-}
-__setup("panic=", panic_setup);
-
 static long no_blink(long time)
 {
        return 0;
@@ -143,21 +137,6 @@ NORET_TYPE void panic(const char * fmt, ...)
 
 EXPORT_SYMBOL(panic);
 
-/**
- *     print_tainted - return a string to represent the kernel taint state.
- *
- *  'P' - Proprietary module has been loaded.
- *  'F' - Module has been forcibly loaded.
- *  'S' - SMP with CPUs not designed for SMP.
- *  'R' - User forced a module unload.
- *  'M' - System experienced a machine check exception.
- *  'B' - System has hit bad_page.
- *  'U' - Userspace-defined naughtiness.
- *  'A' - ACPI table overridden.
- *  'W' - Taint on warning.
- *
- *     The string is overwritten by the next call to print_taint().
- */
 
 struct tnt {
        u8 bit;
@@ -176,8 +155,26 @@ static const struct tnt tnts[] = {
        { TAINT_DIE, 'D', ' ' },
        { TAINT_OVERRIDDEN_ACPI_TABLE, 'A', ' ' },
        { TAINT_WARN, 'W', ' ' },
+       { TAINT_CRAP, 'C', ' ' },
 };
 
+/**
+ *     print_tainted - return a string to represent the kernel taint state.
+ *
+ *  'P' - Proprietary module has been loaded.
+ *  'F' - Module has been forcibly loaded.
+ *  'S' - SMP with CPUs not designed for SMP.
+ *  'R' - User forced a module unload.
+ *  'M' - System experienced a machine check exception.
+ *  'B' - System has hit bad_page.
+ *  'U' - Userspace-defined naughtiness.
+ *  'D' - Kernel has oopsed before
+ *  'A' - ACPI table overridden.
+ *  'W' - Taint on warning.
+ *  'C' - modules from drivers/staging are loaded.
+ *
+ *     The string is overwritten by the next call to print_taint().
+ */
 const char *print_tainted(void)
 {
        static char buf[ARRAY_SIZE(tnts) + sizeof("Tainted: ") + 1];
@@ -216,13 +213,6 @@ void add_taint(unsigned flag)
 }
 EXPORT_SYMBOL(add_taint);
 
-static int __init pause_on_oops_setup(char *str)
-{
-       pause_on_oops = simple_strtoul(str, NULL, 0);
-       return 1;
-}
-__setup("pause_on_oops=", pause_on_oops_setup);
-
 static void spin_msec(int msecs)
 {
        int i;
@@ -309,6 +299,8 @@ static int init_oops_id(void)
 {
        if (!oops_id)
                get_random_bytes(&oops_id, sizeof(oops_id));
+       else
+               oops_id++;
 
        return 0;
 }
@@ -332,36 +324,27 @@ void oops_exit(void)
 }
 
 #ifdef WANT_WARN_ON_SLOWPATH
-void warn_on_slowpath(const char *file, int line)
-{
-       char function[KSYM_SYMBOL_LEN];
-       unsigned long caller = (unsigned long) __builtin_return_address(0);
-       sprint_symbol(function, caller);
-
-       printk(KERN_WARNING "------------[ cut here ]------------\n");
-       printk(KERN_WARNING "WARNING: at %s:%d %s()\n", file,
-               line, function);
-       print_modules();
-       dump_stack();
-       print_oops_end_marker();
-       add_taint(TAINT_WARN);
-}
-EXPORT_SYMBOL(warn_on_slowpath);
-
-
 void warn_slowpath(const char *file, int line, const char *fmt, ...)
 {
        va_list args;
        char function[KSYM_SYMBOL_LEN];
        unsigned long caller = (unsigned long)__builtin_return_address(0);
+       const char *board;
+
        sprint_symbol(function, caller);
 
        printk(KERN_WARNING "------------[ cut here ]------------\n");
        printk(KERN_WARNING "WARNING: at %s:%d %s()\n", file,
                line, function);
-       va_start(args, fmt);
-       vprintk(fmt, args);
-       va_end(args);
+       board = dmi_get_system_info(DMI_PRODUCT_NAME);
+       if (board)
+               printk(KERN_WARNING "Hardware name: %s\n", board);
+
+       if (fmt) {
+               va_start(args, fmt);
+               vprintk(fmt, args);
+               va_end(args);
+       }
 
        print_modules();
        dump_stack();
@@ -382,3 +365,6 @@ void __stack_chk_fail(void)
 }
 EXPORT_SYMBOL(__stack_chk_fail);
 #endif
+
+core_param(panic, panic_timeout, int, 0644);
+core_param(pause_on_oops, pause_on_oops, int, 0644);