svn commit: r249148 - in stable/9/sys/geom: . bde uncompress uzip

Alexander Motin mav at FreeBSD.org
Fri Apr 5 10:35:37 UTC 2013


Author: mav
Date: Fri Apr  5 10:35:36 2013
New Revision: 249148
URL: http://svnweb.freebsd.org/changeset/base/249148

Log:
  MFC r238198 (by trasz):
  Fix orphan() methods of several GEOM classes to not assume that there
  is an error set on the provider.  With GEOM resizing, class can become
  orphaned when it doesn't implement resize() method and the provider size
  decreases.

Modified:
  stable/9/sys/geom/bde/g_bde.c
  stable/9/sys/geom/geom_aes.c
  stable/9/sys/geom/geom_slice.c
  stable/9/sys/geom/uncompress/g_uncompress.c
  stable/9/sys/geom/uzip/g_uzip.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/geom/bde/g_bde.c
==============================================================================
--- stable/9/sys/geom/bde/g_bde.c	Fri Apr  5 10:30:37 2013	(r249147)
+++ stable/9/sys/geom/bde/g_bde.c	Fri Apr  5 10:35:36 2013	(r249148)
@@ -77,19 +77,15 @@ g_bde_orphan(struct g_consumer *cp)
 	struct g_geom *gp;
 	struct g_provider *pp;
 	struct g_bde_softc *sc;
-	int error;
 
 	g_trace(G_T_TOPOLOGY, "g_bde_orphan(%p/%s)", cp, cp->provider->name);
 	g_topology_assert();
-	KASSERT(cp->provider->error != 0,
-		("g_bde_orphan with error == 0"));
 
 	gp = cp->geom;
 	sc = gp->softc;
 	gp->flags |= G_GEOM_WITHER;
-	error = cp->provider->error;
 	LIST_FOREACH(pp, &gp->provider, provider)
-		g_orphan_provider(pp, error);
+		g_orphan_provider(pp, ENXIO);
 	bzero(sc, sizeof(struct g_bde_softc));	/* destroy evidence */
 	return;
 }

Modified: stable/9/sys/geom/geom_aes.c
==============================================================================
--- stable/9/sys/geom/geom_aes.c	Fri Apr  5 10:30:37 2013	(r249147)
+++ stable/9/sys/geom/geom_aes.c	Fri Apr  5 10:35:36 2013	(r249148)
@@ -241,12 +241,10 @@ g_aes_orphan(struct g_consumer *cp)
 
 	g_trace(G_T_TOPOLOGY, "g_aes_orphan(%p/%s)", cp, cp->provider->name);
 	g_topology_assert();
-	KASSERT(cp->provider->error != 0,
-		("g_aes_orphan with error == 0"));
 
 	gp = cp->geom;
 	sc = gp->softc;
-	g_wither_geom(gp, cp->provider->error);
+	g_wither_geom(gp, ENXIO);
 	bzero(sc, sizeof(struct g_aes_softc));	/* destroy evidence */
 	g_free(sc);
 	return;

Modified: stable/9/sys/geom/geom_slice.c
==============================================================================
--- stable/9/sys/geom/geom_slice.c	Fri Apr  5 10:30:37 2013	(r249147)
+++ stable/9/sys/geom/geom_slice.c	Fri Apr  5 10:35:36 2013	(r249148)
@@ -522,10 +522,8 @@ g_slice_orphan(struct g_consumer *cp)
 
 	g_trace(G_T_TOPOLOGY, "g_slice_orphan(%p/%s)", cp, cp->provider->name);
 	g_topology_assert();
-	KASSERT(cp->provider->error != 0,
-	    ("g_slice_orphan with error == 0"));
 
 	/* XXX: Not good enough we leak the softc and its suballocations */
 	g_slice_free(cp->geom->softc);
-	g_wither_geom(cp->geom, cp->provider->error);
+	g_wither_geom(cp->geom, ENXIO);
 }

Modified: stable/9/sys/geom/uncompress/g_uncompress.c
==============================================================================
--- stable/9/sys/geom/uncompress/g_uncompress.c	Fri Apr  5 10:30:37 2013	(r249147)
+++ stable/9/sys/geom/uncompress/g_uncompress.c	Fri Apr  5 10:35:36 2013	(r249148)
@@ -406,13 +406,11 @@ g_uncompress_orphan(struct g_consumer *c
 	g_trace(G_T_TOPOLOGY, "%s(%p/%s)", __func__, cp,
 		cp->provider->name);
 	g_topology_assert();
-	KASSERT(cp->provider->error != 0,
-		("g_uncompress_orphan with error == 0"));
 
 	gp = cp->geom;
 	g_uncompress_softc_free(gp->softc, gp);
 	gp->softc = NULL;
-	g_wither_geom(gp, cp->provider->error);
+	g_wither_geom(gp, ENXIO);
 }
 
 static int

Modified: stable/9/sys/geom/uzip/g_uzip.c
==============================================================================
--- stable/9/sys/geom/uzip/g_uzip.c	Fri Apr  5 10:30:37 2013	(r249147)
+++ stable/9/sys/geom/uzip/g_uzip.c	Fri Apr  5 10:35:36 2013	(r249148)
@@ -313,13 +313,11 @@ g_uzip_orphan(struct g_consumer *cp)
 
 	g_trace(G_T_TOPOLOGY, "g_uzip_orphan(%p/%s)", cp, cp->provider->name);
 	g_topology_assert();
-	KASSERT(cp->provider->error != 0,
-		("g_uzip_orphan with error == 0"));
 
 	gp = cp->geom;
 	g_uzip_softc_free(gp->softc, gp);
 	gp->softc = NULL;
-	g_wither_geom(gp, cp->provider->error);
+	g_wither_geom(gp, ENXIO);
 }
 
 static int


More information about the svn-src-stable-9 mailing list