Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Oct 2009 21:08:07 +0000 (UTC)
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r198003 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci geom/concat geom/label geom/part geom/shsec geom/stripe geom/uzip
Message-ID:  <200910122108.n9CL87LV085816@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pjd
Date: Mon Oct 12 21:08:06 2009
New Revision: 198003
URL: http://svn.freebsd.org/changeset/base/198003

Log:
  MFC r197898:
  
  If provider is open for writing when we taste it, skip it for classes that
  depend on on-disk metadata. This was we won't attach to providers that are used
  by other classes. For example we don't want to configure partitions on da0 if
  it is part of gmirror, what we really want is partitions on mirror/foo.
  
  During regular work it works like this: if provider is open for writing a class
  receives the spoiled event from GEOM and detaches, once provider is closed the
  taste event is send again and class can rediscover its metadata if it is still
  there.  This doesn't work that way when new class arrives, because GEOM gives
  all existing providers for it to taste, also those open for writing. Classes
  have to decided on their own if they want to deal with such providers (eg.
  geom_dev) or not (classes modified by this commit).
  
  Reported by:	des, Oliver Lehmann <lehmann@ans-netz.de>
  Tested by:	des, Oliver Lehmann <lehmann@ans-netz.de>
  Discussed with:	phk, marcel
  Reviewed by:	marcel
  Approved by:	re (kib)

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/concat/g_concat.c
  stable/8/sys/geom/label/g_label.c
  stable/8/sys/geom/part/g_part.c
  stable/8/sys/geom/shsec/g_shsec.c
  stable/8/sys/geom/stripe/g_stripe.c
  stable/8/sys/geom/uzip/g_uzip.c

Modified: stable/8/sys/geom/concat/g_concat.c
==============================================================================
--- stable/8/sys/geom/concat/g_concat.c	Mon Oct 12 21:03:07 2009	(r198002)
+++ stable/8/sys/geom/concat/g_concat.c	Mon Oct 12 21:08:06 2009	(r198003)
@@ -599,6 +599,10 @@ g_concat_taste(struct g_class *mp, struc
 	g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, pp->name);
 	g_topology_assert();
 
+	/* Skip providers that are already open for writing. */
+	if (pp->acw > 0)
+		return (NULL);
+
 	G_CONCAT_DEBUG(3, "Tasting %s.", pp->name);
 
 	gp = g_new_geomf(mp, "concat:taste");

Modified: stable/8/sys/geom/label/g_label.c
==============================================================================
--- stable/8/sys/geom/label/g_label.c	Mon Oct 12 21:03:07 2009	(r198002)
+++ stable/8/sys/geom/label/g_label.c	Mon Oct 12 21:08:06 2009	(r198003)
@@ -271,6 +271,10 @@ g_label_taste(struct g_class *mp, struct
 
 	G_LABEL_DEBUG(2, "Tasting %s.", pp->name);
 
+	/* Skip providers that are already open for writing. */
+	if (pp->acw > 0)
+		return (NULL);
+
 	if (strcmp(pp->geom->class->name, mp->name) == 0)
 		return (NULL);
 

Modified: stable/8/sys/geom/part/g_part.c
==============================================================================
--- stable/8/sys/geom/part/g_part.c	Mon Oct 12 21:03:07 2009	(r198002)
+++ stable/8/sys/geom/part/g_part.c	Mon Oct 12 21:08:06 2009	(r198003)
@@ -1459,6 +1459,10 @@ g_part_taste(struct g_class *mp, struct 
 	G_PART_TRACE((G_T_TOPOLOGY, "%s(%s,%s)", __func__, mp->name, pp->name));
 	g_topology_assert();
 
+	/* Skip providers that are already open for writing. */
+	if (pp->acw > 0)
+		return (NULL);
+
 	/*
 	 * Create a GEOM with consumer and hook it up to the provider.
 	 * With that we become part of the topology. Optain read access

Modified: stable/8/sys/geom/shsec/g_shsec.c
==============================================================================
--- stable/8/sys/geom/shsec/g_shsec.c	Mon Oct 12 21:03:07 2009	(r198002)
+++ stable/8/sys/geom/shsec/g_shsec.c	Mon Oct 12 21:08:06 2009	(r198003)
@@ -638,6 +638,10 @@ g_shsec_taste(struct g_class *mp, struct
 	g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, pp->name);
 	g_topology_assert();
 
+	/* Skip providers that are already open for writing. */
+	if (pp->acw > 0)
+		return (NULL);
+
 	G_SHSEC_DEBUG(3, "Tasting %s.", pp->name);
 
 	gp = g_new_geomf(mp, "shsec:taste");

Modified: stable/8/sys/geom/stripe/g_stripe.c
==============================================================================
--- stable/8/sys/geom/stripe/g_stripe.c	Mon Oct 12 21:03:07 2009	(r198002)
+++ stable/8/sys/geom/stripe/g_stripe.c	Mon Oct 12 21:08:06 2009	(r198003)
@@ -913,6 +913,10 @@ g_stripe_taste(struct g_class *mp, struc
 	g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, pp->name);
 	g_topology_assert();
 
+	/* Skip providers that are already open for writing. */
+	if (pp->acw > 0)
+		return (NULL);
+
 	G_STRIPE_DEBUG(3, "Tasting %s.", pp->name);
 
 	gp = g_new_geomf(mp, "stripe:taste");

Modified: stable/8/sys/geom/uzip/g_uzip.c
==============================================================================
--- stable/8/sys/geom/uzip/g_uzip.c	Mon Oct 12 21:03:07 2009	(r198002)
+++ stable/8/sys/geom/uzip/g_uzip.c	Mon Oct 12 21:08:06 2009	(r198003)
@@ -363,6 +363,11 @@ g_uzip_taste(struct g_class *mp, struct 
 
 	g_trace(G_T_TOPOLOGY, "g_uzip_taste(%s,%s)", mp->name, pp->name);
 	g_topology_assert();
+
+	/* Skip providers that are already open for writing. */
+	if (pp->acw > 0)
+		return (NULL);
+
 	buf = NULL;
 
 	/*



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