From owner-freebsd-geom@FreeBSD.ORG Sat Sep 22 17:07:55 2012 Return-Path: Delivered-To: freebsd-geom@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 211771065670 for ; Sat, 22 Sep 2012 17:07:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 519DA8FC15 for ; Sat, 22 Sep 2012 17:07:54 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id UAA07546 for ; Sat, 22 Sep 2012 20:07:52 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1TFTBI-000NUY-Fm for freebsd-geom@FreeBSD.org; Sat, 22 Sep 2012 20:07:52 +0300 Message-ID: <505DF067.9020700@FreeBSD.org> Date: Sat, 22 Sep 2012 20:07:51 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:15.0) Gecko/20120913 Thunderbird/15.0.1 MIME-Version: 1.0 To: freebsd-geom@FreeBSD.org X-Enigmail-Version: 1.4.3 Content-Type: text/plain; charset=X-VIET-VPS Content-Transfer-Encoding: 7bit Cc: Subject: g_part_taste: directly destroy consumer and geom when tasting fails X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 17:07:55 -0000 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 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