]> git.proxmox.com Git - mirror_spl-debian.git/blobdiff - module/spl/spl-err.c
New upstream version 0.7.2
[mirror_spl-debian.git] / module / spl / spl-err.c
index cf9f096b11cb200053a699738471e6680f907993..2f66b6e23cb6fc5d4eecc72e34d97ebb9ab146d3 100644 (file)
 #include <sys/cmn_err.h>
 #include <linux/ratelimit.h>
 
+/*
+ * It is often useful to actually have the panic crash the node so you
+ * can then get notified of the event, get the crashdump for later
+ * analysis and other such goodies.
+ * But we would still default to the current default of not to do that.
+ */
+unsigned int spl_panic_halt;
+module_param(spl_panic_halt, uint, 0644);
+MODULE_PARM_DESC(spl_panic_halt,
+                "Cause kernel panic on assertion failures");
+
 /*
  * Limit the number of stack traces dumped to not more than 5 every
  * 60 seconds to prevent denial-of-service attacks from debug code.
@@ -62,6 +73,9 @@ spl_panic(const char *file, const char *func, int line, const char *fmt, ...) {
 
        printk(KERN_EMERG "%s", msg);
        printk(KERN_EMERG "PANIC at %s:%d:%s()\n", newfile, line, func);
+       if (spl_panic_halt)
+               panic("%s", msg);
+
        spl_dumpstack();
 
        /* Halt the thread to facilitate further debugging */