Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Sep 2013 20:05:16 +0000 (UTC)
From:      Dag-Erling Smørgrav <des@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r255860 - head/sys/geom
Message-ID:  <201309242005.r8OK5GBL016518@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: des
Date: Tue Sep 24 20:05:16 2013
New Revision: 255860
URL: http://svnweb.freebsd.org/changeset/base/255860

Log:
  Introduce a kern.geom.notaste sysctl that can be used to temporarily
  disable GEOM tasting to avoid the "bouncing GEOM" problem where, when
  you shut down the consumer of a provider which can be viewed in multiple
  ways (typically a mirror whose members are labeled partitions), GEOM
  will immediately taste that provider's alter ego and reattach the
  consumer.
  
  Approved by:	re (glebius)

Modified:
  head/sys/geom/geom_int.h
  head/sys/geom/geom_kern.c
  head/sys/geom/geom_subr.c

Modified: head/sys/geom/geom_int.h
==============================================================================
--- head/sys/geom/geom_int.h	Tue Sep 24 19:09:21 2013	(r255859)
+++ head/sys/geom/geom_int.h	Tue Sep 24 20:05:16 2013	(r255860)
@@ -75,6 +75,7 @@ void g_io_schedule_up(struct thread *tp)
 /* geom_kern.c / geom_kernsim.c */
 void g_init(void);
 extern int g_shutdown;
+extern int g_notaste;
 
 /* geom_ctl.c */
 void g_ctl_init(void);

Modified: head/sys/geom/geom_kern.c
==============================================================================
--- head/sys/geom/geom_kern.c	Tue Sep 24 19:09:21 2013	(r255859)
+++ head/sys/geom/geom_kern.c	Tue Sep 24 20:05:16 2013	(r255860)
@@ -66,6 +66,7 @@ static struct thread *g_event_td;
 int g_debugflags;
 int g_collectstats = 1;
 int g_shutdown;
+int g_notaste;
 
 /*
  * G_UP and G_DOWN are the two threads which push I/O through the
@@ -208,6 +209,9 @@ TUNABLE_INT("kern.geom.debugflags", &g_d
 SYSCTL_INT(_kern_geom, OID_AUTO, debugflags, CTLFLAG_RW,
 	&g_debugflags, 0, "Set various trace levels for GEOM debugging");
 
+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");

Modified: head/sys/geom/geom_subr.c
==============================================================================
--- head/sys/geom/geom_subr.c	Tue Sep 24 19:09:21 2013	(r255859)
+++ head/sys/geom/geom_subr.c	Tue Sep 24 20:05:16 2013	(r255860)
@@ -271,7 +271,7 @@ g_retaste_event(void *arg, int flag)
 	g_topology_assert();
 	if (flag == EV_CANCEL)  /* XXX: can't happen ? */
 		return;
-	if (g_shutdown)
+	if (g_shutdown || g_notaste)
 		return;
 
 	hh = arg;
@@ -540,6 +540,8 @@ g_new_provider_event(void *arg, int flag
 		    cp->geom->attrchanged != NULL)
 			cp->geom->attrchanged(cp, "GEOM::media");
 	}
+	if (g_notaste)
+		return;
 	LIST_FOREACH(mp, &g_classes, class) {
 		if (mp->taste == NULL)
 			continue;



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