aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2025-11-04 20:53:14 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2025-11-04 22:55:20 +0000
commit7d495be8d4bd3a0e315233346b2f7267b8390612 (patch)
treecd809f43003dd179a4b960a2edec86203198cedc
parent9521b0b91ea31b7f31b3800772ac6502c822ae56 (diff)
exterr: print exterr for struct buf and bio in ddb show commands
Noted by: imp Sponsored by: The FreeBSD Foundation
-rw-r--r--sys/geom/geom_subr.c4
-rw-r--r--sys/kern/vfs_bio.c2
-rw-r--r--sys/sys/exterr_cat.h1
3 files changed, 7 insertions, 0 deletions
diff --git a/sys/geom/geom_subr.c b/sys/geom/geom_subr.c
index c70d55c6c321..c5dce730da79 100644
--- a/sys/geom/geom_subr.c
+++ b/sys/geom/geom_subr.c
@@ -38,9 +38,11 @@
#include <sys/cdefs.h>
#include "opt_ddb.h"
+#define EXTERR_CATEGORY EXTERR_CAT_GEOM
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/devicestat.h>
+#include <sys/exterrvar.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/bio.h>
@@ -1674,6 +1676,8 @@ DB_SHOW_COMMAND(bio, db_show_bio)
db_printf(" caller2: %p\n", bp->bio_caller2);
db_printf(" bio_from: %p\n", bp->bio_from);
db_printf(" bio_to: %p\n", bp->bio_to);
+ if ((bp->bio_flags & BIO_EXTERR) != 0)
+ exterr_db_print(&bp->bio_exterr);
#if defined(BUF_TRACKING) || defined(FULL_BUF_TRACKING)
db_printf(" bio_track_bp: %p\n", bp->bio_track_bp);
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index 22b7fe8d059a..880cc6b99951 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -5529,6 +5529,8 @@ DB_SHOW_COMMAND(buffer, db_show_buffer)
db_printf("\n");
}
BUF_LOCKPRINTINFO(bp);
+ if ((bp->b_ioflags & BIO_EXTERR) != 0)
+ exterr_db_print(&bp->b_exterr);
#if defined(FULL_BUF_TRACKING)
db_printf("b_io_tracking: b_io_tcnt = %u\n", bp->b_io_tcnt);
diff --git a/sys/sys/exterr_cat.h b/sys/sys/exterr_cat.h
index 34a4b9f86694..318e774542ca 100644
--- a/sys/sys/exterr_cat.h
+++ b/sys/sys/exterr_cat.h
@@ -23,6 +23,7 @@
#define EXTERR_CAT_VFSSYSCALL 9
#define EXTERR_CAT_VFSBIO 10
#define EXTERR_CAT_GEOMVFS 11
+#define EXTERR_CAT_GEOM 12
#endif