Skip to content

Commit

Permalink
Skip __zfs_dbgmsg in a DPC (#104)
Browse files Browse the repository at this point in the history
* Skip dprintf in a DPC

Add a check to dprintf that will avoid trying to write to the debug log if we are in a IRQL of DISPATCH_LEVEL or higher.
Otherwise we will get a BSOD when __zfs_dbgmsg tries to grab a mutex.
#103

* dprintf avoid bsod while still providing information

* Revert: dprintf avoid bsod while still providing information
  • Loading branch information
andrewc12 authored Jul 8, 2022
1 parent a74333c commit f66b080
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions module/os/windows/zfs/zfs_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,13 @@ __dprintf(boolean_t dprint, const char *file, const char *func,
char *prefix = (dprint) ? "dprintf: " : "";
const char *newfile;

/*
* Skip everything if we can't write to the debug log due to
* being in a DPC.
*/
if (KeGetCurrentIrql() >= DISPATCH_LEVEL)
return;

/*
* Get rid of annoying prefix to filename.
*/
Expand Down

0 comments on commit f66b080

Please sign in to comment.