Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Sep 2013 22:04:36 +0200
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= <des@des.no>
Cc:        geom@freebsd.org
Subject:   Re: Disable tasting through sysctl
Message-ID:  <20130923200436.GF1407@garage.freebsd.pl>
In-Reply-To: <86fvsxd9fe.fsf@nine.des.no>
References:  <86fvsxd9fe.fsf@nine.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help

--AjmyJqqohANyBN/e
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, Sep 22, 2013 at 01:47:17AM +0200, Dag-Erling Sm=F8rgrav wrote:
> The patch below is a workaround for the "bouncing geom" problem that
> occurs primarily with labels.  Say da0p1 and da1p1 are labeled "mir0"
> and "mir1" respectively, so they exist both as /dev/da[01]p1 and as
> /dev/gpt/mir[01].  Create a mirror on top of gpt/mir[01], then stop the
> mirror.  GEOM won't retaste gpt/root[01], but it will see and taste

Do you mean gpt/mir[01]?

> da[01]p1, and the mirror will immediately reappear.  The patch adds a
> sysctl which can be used to temporarily disable tasting so you can stop
> the mirror and safely disconnect the disks.

For example gmirror has an option to hardcore provider names in
metadata (-h), so it will ignore da[01]p1.

I was in need to such an option few time myself, so it is fine by me.

> Index: sys/geom/geom_int.h
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- sys/geom/geom_int.h	(revision 255780)
> +++ sys/geom/geom_int.h	(working copy)
> @@ -75,6 +75,7 @@
>  /* geom_kern.c / geom_kernsim.c */
>  void g_init(void);
>  extern int g_shutdown;
> +extern int g_notaste;
> =20
>  /* geom_ctl.c */
>  void g_ctl_init(void);
> Index: sys/geom/geom_kern.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- sys/geom/geom_kern.c	(revision 255780)
> +++ sys/geom/geom_kern.c	(working copy)
> @@ -66,6 +66,7 @@
>  int g_debugflags;
>  int g_collectstats =3D 1;
>  int g_shutdown;
> +int g_notaste;
> =20
>  /*
>   * G_UP and G_DOWN are the two threads which push I/O through the
> @@ -208,6 +209,9 @@
>  SYSCTL_INT(_kern_geom, OID_AUTO, debugflags, CTLFLAG_RW,
>  	&g_debugflags, 0, "Set various trace levels for GEOM debugging");
> =20
> +SYSCTL_INT(_kern_geom, OID_AUTO, notaste, CTLFLAG_RW,
> +	&g_notaste, 0, "Prevent GEOM tasting");
> +
>  SYSCTL_INT(_kern_geom, OID_AUTO, collectstats, CTLFLAG_RW,
>  	&g_collectstats, 0,
>  	"Control statistics collection on GEOM providers and consumers");
> Index: sys/geom/geom_subr.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- sys/geom/geom_subr.c	(revision 255780)
> +++ sys/geom/geom_subr.c	(working copy)
> @@ -271,7 +271,7 @@
>  	g_topology_assert();
>  	if (flag =3D=3D EV_CANCEL)  /* XXX: can't happen ? */
>  		return;
> -	if (g_shutdown)
> +	if (g_shutdown || g_notaste)
>  		return;
> =20
>  	hh =3D arg;
> @@ -540,6 +540,8 @@
>  		    cp->geom->attrchanged !=3D NULL)
>  			cp->geom->attrchanged(cp, "GEOM::media");
>  	}
> +	if (g_notaste)
> +		return;
>  	LIST_FOREACH(mp, &g_classes, class) {
>  		if (mp->taste =3D=3D NULL)
>  			continue;
> _______________________________________________
> freebsd-geom@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-geom
> To unsubscribe, send any mail to "freebsd-geom-unsubscribe@freebsd.org"

--=20
Pawel Jakub Dawidek                       http://www.wheelsystems.com
FreeBSD committer                         http://www.FreeBSD.org
Am I Evil? Yes, I Am!                     http://mobter.com

--AjmyJqqohANyBN/e
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (FreeBSD)

iEYEARECAAYFAlJAntQACgkQForvXbEpPzQRBwCggLOW0svTfG4TZ6mGu7nwKTnl
U6EAoNsnZb/XA12l+Cv0lhLTJ062rxv/
=JCnY
-----END PGP SIGNATURE-----

--AjmyJqqohANyBN/e--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130923200436.GF1407>