mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
Implement -A (ignore ASSERTs) for zdb
The command line switch -A (ignore ASSERTs) has always been available in zdb but was never connected up to the correct global variable. There are times when you need zdb to ignore asserts and keep dumping out whatever information it can get despite the ASSERT(s) failing. It was always intended to be part of zdb but was incomplete. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Paul Zuchowski <pzuchowski@datto.com> Closes #9610
This commit is contained in:
committed by
Tony Hutter
parent
36fe63042c
commit
48be45cd2d
@@ -33,11 +33,18 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifndef _KERNEL
|
||||
int aok;
|
||||
#endif
|
||||
|
||||
static inline int
|
||||
libspl_assert(const char *buf, const char *file, const char *func, int line)
|
||||
{
|
||||
fprintf(stderr, "%s\n", buf);
|
||||
fprintf(stderr, "ASSERT at %s:%d:%s()", file, line, func);
|
||||
if (aok) {
|
||||
return (0);
|
||||
}
|
||||
abort();
|
||||
}
|
||||
|
||||
@@ -52,6 +59,9 @@ libspl_assertf(const char *file, const char *func, int line, char *format, ...)
|
||||
fprintf(stderr, "\n");
|
||||
fprintf(stderr, "ASSERT at %s:%d:%s()", file, line, func);
|
||||
va_end(args);
|
||||
if (aok) {
|
||||
return;
|
||||
}
|
||||
abort();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user