From owner-freebsd-geom@FreeBSD.ORG Wed Oct 19 18:03:34 2005 Return-Path: X-Original-To: freebsd-geom@freebsd.org 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 3395016A41F for ; Wed, 19 Oct 2005 18:03:34 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.FreeBSD.org (Postfix) with ESMTP id C1FD043D5D for ; Wed, 19 Oct 2005 18:03:33 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.48.2]) by phk.freebsd.dk (Postfix) with ESMTP id C0267BC84; Wed, 19 Oct 2005 18:03:29 +0000 (UTC) To: Szalai Andras From: "Poul-Henning Kamp" In-Reply-To: Your message of "Wed, 19 Oct 2005 19:53:10 +0200." <20051019175310.GC76081@web.djw.hu> Date: Wed, 19 Oct 2005 20:03:27 +0200 Message-ID: <5675.1129745007@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: freebsd-geom@freebsd.org Subject: Re: geom orphan question 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: Wed, 19 Oct 2005 18:03:34 -0000 In message <20051019175310.GC76081@web.djw.hu>, Szalai Andras writes: >I have spent few hours trying to understand geom. The I/O >path is more or less okay, but I have problems with >the orphanization procedure. > >For example, if you look into g_concat.c there is a >g_concat_orphan function that calls g_concat_remove_disk. >In this function, gconcat > >1) orphans its own provider (g_orphan_provider), >2) reset access counts (g_access), >3) detach consumer from the lower layer provider, >4) destroy the consumer. > >In order to detach the consumer (step 3) you have to be sure >that there are no active requests (bios) between the consumer and >provider. My question is how can I guarantee that there are >no active bios when I call g_detach? There are counters in consumers and providers which can tell you that. The above code seems to play fast and loose with that aspect. -- 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.