aboutsummaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2010-04-23 15:55:02 -0700
committerBrian Behlendorf <[email protected]>2010-04-23 15:55:02 -0700
commit97f8f6d78999ab41d23cf5942d55ea3ad0ca4f3e (patch)
tree4e3182a21a45cd3ab043a75773cc4848ddd436a1 /module
parentd05ec4b45f77c0f401098d88b5299ef090c73ca9 (diff)
Dump log from current process when required
When dumping a debug log first check that it is safe to create a new thread and block waiting for it. If we are in an atomic context or irqs and disabled it is not safe to sleep and we must write out of the debug log from the current process.
Diffstat (limited to 'module')
-rw-r--r--module/spl/spl-debug.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/module/spl/spl-debug.c b/module/spl/spl-debug.c
index a3fcd74e0..0602a1a89 100644
--- a/module/spl/spl-debug.c
+++ b/module/spl/spl-debug.c
@@ -1112,6 +1112,9 @@ void spl_debug_bug(char *file, const char *func, const int line, int flags)
/* not reached */
}
+ if (in_atomic() || irqs_disabled())
+ flags |= DL_NOTHREAD;
+
/* Ensure all debug pages and dumped by current cpu */
if (spl_debug_panic_on_bug)
spl_panic_in_progress = 1;