From owner-freebsd-geom@FreeBSD.ORG Thu Jul 8 17:15:45 2004 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2A9E716A52C; Thu, 8 Jul 2004 17:15:45 +0000 (GMT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 562AF43D64; Thu, 8 Jul 2004 17:15:44 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.11/8.12.11) with ESMTP id i68HFhao003839; Thu, 8 Jul 2004 19:15:43 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: Pawel Jakub Dawidek From: "Poul-Henning Kamp" In-Reply-To: Your message of "Wed, 07 Jul 2004 03:29:04 +0200." <20040707012904.GP12007@darkness.comp.waw.pl> Date: Thu, 08 Jul 2004 19:15:43 +0200 Message-ID: <3838.1089306943@critter.freebsd.dk> Sender: phk@critter.freebsd.dk cc: geom@freebsd.org Subject: Re: Current GEOM problems. X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2004 17:15:45 -0000 In message <20040707012904.GP12007@darkness.comp.waw.pl>, Pawel Jakub Dawidek w rites: >2. Every class which use geom_slice cannot be unload when it has geoms > (actually providers), because g_slice_destroy_geom() calls > g_slice_spoiled() and g_slice_spoiled() calls g_wither_geom(). > If there are providers, geom will not be imediately destroyed, > but orphan event will be send, so next time when g_slice_destroy_geom() > will be called for the same geom it will panic, because gp->softc is > NULL. can you try this untested patch ? Index: geom_slice.c =================================================================== RCS file: /home/ncvs/src/sys/geom/geom_slice.c,v retrieving revision 1.54 diff -u -r1.54 geom_slice.c --- geom_slice.c 4 Jul 2004 13:44:48 -0000 1.54 +++ geom_slice.c 8 Jul 2004 17:15:12 -0000 @@ -439,8 +439,13 @@ int g_slice_destroy_geom(struct gctl_req *req, struct g_class *mp, struct g_geom *gp) { + struct g_slicer *gsp; - g_slice_spoiled(LIST_FIRST(&gp->consumer)); + g_topology_assert(); + gsp = gp->softc; + gp->softc = NULL; + g_slice_free(gsp); + g_wither_geom(gp, ENXIO); return (0); } -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.