--- geom_int.h.orig Wed Apr 6 18:51:51 2005 +++ geom_int.h Wed Apr 6 18:51:15 2005 @@ -40,6 +40,7 @@ extern int g_collectstats; extern int g_debugflags; +extern int g_part_table_write; /* * 1 G_T_TOPOLOGY * 2 G_T_BIO --- geom_kern.c.orig Wed Apr 6 13:48:53 2005 +++ geom_kern.c Wed Apr 6 18:51:35 2005 @@ -59,6 +59,7 @@ static struct proc *g_up_proc; int g_debugflags; +int g_part_table_write; int g_collectstats = 1; int g_shutdown; @@ -223,6 +224,11 @@ TUNABLE_INT("kern.geom.debugflags", &g_debugflags); SYSCTL_INT(_kern_geom, OID_AUTO, debugflags, CTLFLAG_RW, &g_debugflags, 0, ""); + +TUNABLE_INT("kern.geom.part_table_write", &g_part_table_write); +SYSCTL_INT(_kern_geom, OID_AUTO, part_table_write, CTLFLAG_RW, + &g_part_table_write, 0, "If set to 1, writing to the \ + partition table is allowed"); SYSCTL_INT(_kern_geom, OID_AUTO, collectstats, CTLFLAG_RW, &g_collectstats, 0, ""); --- geom_subr.c.orig Wed Apr 6 13:56:04 2005 +++ geom_subr.c Wed Apr 6 18:51:31 2005 @@ -669,7 +669,7 @@ pp, pp->name); /* If foot-shooting is enabled, any open on rank#1 is OK */ - if ((g_debugflags & 16) && pp->geom->rank == 1) + if ((g_part_table_write & 1) && pp->geom->rank == 1) ; /* If we try exclusive but already write: fail */ else if (dce > 0 && pw > 0)