Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Sep 2012 20:07:51 +0300
From:      Andriy Gapon <avg@FreeBSD.org>
To:        freebsd-geom@FreeBSD.org
Subject:   g_part_taste: directly destroy consumer and geom when tasting fails
Message-ID:  <505DF067.9020700@FreeBSD.org>

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

What do you think about the following change?
The withering also has unpleasant side effect of preventing subsequent retaste
of a provider if it quickly changes before the withering "taster" geom and
consumer are actually destroyed.

commit 660581a09ee5e7a66a272c8cf4c549170a73a012
Author: Andriy Gapon <avg@icyb.net.ua>
Date:   Wed Sep 19 20:11:32 2012 +0300

    g_part_taste: directly destroy consumer and geom here, no need for withering

diff --git a/sys/geom/part/g_part.c b/sys/geom/part/g_part.c
index 846cd03..9e95e7e 100644
--- a/sys/geom/part/g_part.c
+++ b/sys/geom/part/g_part.c
@@ -1885,7 +1885,10 @@ g_part_taste(struct g_class *mp, struct g_provider *pp,
int flags __unused)
 	if (error == 0)
 		error = g_access(cp, 1, 0, 0);
 	if (error != 0) {
-		g_part_wither(gp, error);
+		if (cp->provider)
+			g_detach(cp);
+		g_destroy_consumer(cp);
+		g_destroy_geom(gp);
 		return (NULL);
 	}

@@ -1945,7 +1948,9 @@ g_part_taste(struct g_class *mp, struct g_provider *pp,
int flags __unused)
 	g_topology_lock();
 	root_mount_rel(rht);
 	g_access(cp, -1, 0, 0);
-	g_part_wither(gp, error);
+	g_detach(cp);
+	g_destroy_consumer(cp);
+	g_destroy_geom(gp);
 	return (NULL);
 }


-- 
Andriy Gapon



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