diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c index 57dab5f72e4..6ac4a59008c 100644 --- a/sys/geom/geom_disk.c +++ b/sys/geom/geom_disk.c @@ -53,6 +53,7 @@ #include #include #include +#include static struct mtx g_disk_done_mtx; @@ -252,7 +253,8 @@ g_disk_start(struct bio *bp) break; else if (!strcmp(bp->bio_attribute, "GEOM::kerneldump")) g_disk_kerneldump(bp, dp); - else if ((dp->d_ioctl != NULL) && + else if ((g_debugflags & G_F_DISKIOCTL) && + (dp->d_ioctl != NULL) && !strcmp(bp->bio_attribute, "GEOM::ioctl") && bp->bio_length == sizeof *gio) { gio = (struct g_ioctl *)bp->bio_data; diff --git a/sys/geom/geom_int.h b/sys/geom/geom_int.h index 81f80692bb0..0b55670482b 100644 --- a/sys/geom/geom_int.h +++ b/sys/geom/geom_int.h @@ -46,9 +46,12 @@ extern int g_debugflags; * 1 G_T_TOPOLOGY * 2 G_T_BIO * 4 G_T_ACCESS - * 8 enable sanity checks + * 8 Enable sanity checks * 16 Allow footshooting on rank#1 providers + * 32 G_T_DETAILS */ +#define G_F_DISKIOCTL 64 + /* * Various internal actions are tracked by tagging g_event[s] onto