Date: Wed, 6 Apr 2005 20:21:56 +0200 From: Matteo Riondato <rionda@gufi.org> To: Poul-Henning Kamp <phk@phk.freebsd.dk> Cc: Stephen McKay <smckay@internode.on.net> Subject: Re: Can't change partition table anymore Message-ID: <20050406182156.GA649@kaiser.sig11.org> In-Reply-To: <6570.1112773884@critter.freebsd.dk> References: <200504060628.j366SWcW008597@dungeon.home> <6570.1112773884@critter.freebsd.dk>
next in thread | previous in thread | raw e-mail | index | archive | help
--zx4FCpZtqtKETZ7O Content-Type: multipart/mixed; boundary="ew6BAiZeqk4r7MaW" Content-Disposition: inline --ew6BAiZeqk4r7MaW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 06, 2005 at 09:51:24AM +0200, Poul-Henning Kamp wrote: >=20 >=20 > So the sysctl knob is here to stay, one way or another. >=20 > We can argue about what the name of the sysctl should be and where > it should be documented, and every single one of you are able to > sit down and write a patch for your preference and submit it to us. Attached you can find my patch. I'm not a kernel developer so I cannot be sure if mine is the best way to implement this task. Anyway, it works. Best Regards P.s. I don't absolutely argue wether this is a feature or a bug because I simply don't know enough to judge. --=20 Rionda aka Matteo Riondato Disinformato per default G.U.F.I. Staff Member (http://www.gufi.org) FreeSBIE Developer (http://www.freesbie.org) --ew6BAiZeqk4r7MaW Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="geom.diff" Content-Transfer-Encoding: quoted-printable --- 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 @@ =20 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; =20 int g_debugflags; +int g_part_table_write; int g_collectstats =3D 1; int g_shutdown; =20 @@ -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"); =20 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); =20 /* If foot-shooting is enabled, any open on rank#1 is OK */ - if ((g_debugflags & 16) && pp->geom->rank =3D=3D 1) + if ((g_part_table_write & 1) && pp->geom->rank =3D=3D 1) ; /* If we try exclusive but already write: fail */ else if (dce > 0 && pw > 0) --ew6BAiZeqk4r7MaW-- --zx4FCpZtqtKETZ7O Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (FreeBSD) iD8DBQFCVCjE2Mp4pR7Fa+wRAkXAAJ9mu9+FWlDfNS7V4y8Tri8NxOg/VgCfTYaZ u74E0OkJqEVgFz5+1ODtJpE= =p66T -----END PGP SIGNATURE----- --zx4FCpZtqtKETZ7O--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050406182156.GA649>