From owner-freebsd-geom@FreeBSD.ORG Sun Jun 13 17:14:26 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 E1B9D16A4CE for ; Sun, 13 Jun 2004 17:14:26 +0000 (GMT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1B69B43D45 for ; Sun, 13 Jun 2004 17:14:26 +0000 (GMT) (envelope-from phk@phk.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 i5DHEBud087386 for ; Sun, 13 Jun 2004 19:14:12 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: geom@freebsd.org From: Poul-Henning Kamp Date: Sun, 13 Jun 2004 19:14:11 +0200 Message-ID: <87385.1087146851@critter.freebsd.dk> Subject: GEOM class idea... 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: Sun, 13 Jun 2004 17:14:27 -0000 OK, here is one of the more nasty ideas for a GEOM class: Many of us read CD's into iso images, stick them on a harddisk and mount them from there when we need to access them. This usually costs us a md(4) vnode gadget, and that is really a waste. Write a GEOM class which is a slicer, but it needs to work on CD9660 image headers as metadata, and work the following way: Read in the first ISO image onto our archive disk: dd if=/dev/acd0 of=/dev/ad8 bs=2k On close, the disk is tasted, and our "geom_cdarch" class finds a valid CD9660 volume description and attaches to the disk. It extracts the image size from the CD9660 descriptor (offset 0x8050, 32bitLE. Repeated at 0x8054 as 32bitBE) and creates a slice with this ISO image in it. Since there is no valid CD9660 descriptor on the disk right after this image, the remaining free space gets put into a special slice ("ad8.freespace"). To read in the next ISO image: dd if=/dev/acd0 of=/dev/ad8.freespace bs=2k On close the geom_cdarch class looks for a valid CD9660 volume and if it finds one, creates a new slice and recreates the freespace slice with the space now available, and we can repeat the process until we run out of space. Any takers ? -- 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. From owner-freebsd-geom@FreeBSD.ORG Mon Jun 14 14:06:36 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 C5EA716A4CE for ; Mon, 14 Jun 2004 14:06:36 +0000 (GMT) Received: from fitch6.uni2.net (fitch6.uni2.net [130.227.52.109]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8C7D943D1F for ; Mon, 14 Jun 2004 14:06:35 +0000 (GMT) (envelope-from xride@x12.dk) Received: from x12.dk (83.73.136.148.ip.tele2adsl.dk [83.73.136.148]) by fitch6.uni2.net (8.12.6/8.11.6) with ESMTP id i5EE5l3J024158; Mon, 14 Jun 2004 16:05:48 +0200 Received: by x12.dk (Postfix, from userid 666) id 707EA4E; Mon, 14 Jun 2004 16:05:47 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by x12.dk (Postfix) with ESMTP id 5BD334C; Mon, 14 Jun 2004 16:05:47 +0200 (CEST) Date: Mon, 14 Jun 2004 16:05:47 +0200 (CEST) From: Soeren Straarup To: Poul-Henning Kamp In-Reply-To: <87385.1087146851@critter.freebsd.dk> Message-ID: <20040614160301.Y81182-100000@x12.dk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE cc: geom@freebsd.org Subject: Re: GEOM class idea... 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: Mon, 14 Jun 2004 14:06:36 -0000 On Sun, 13 Jun 2004, Poul-Henning Kamp wrote: > > OK, here is one of the more nasty ideas for a GEOM class: > > Many of us read CD's into iso images, stick them on a harddisk and > mount them from there when we need to access them. This usually > costs us a md(4) vnode gadget, and that is really a waste. > > Write a GEOM class which is a slicer, but it needs to work on CD9660 > image headers as metadata, and work the following way: > > Read in the first ISO image onto our archive disk: > > =09dd if=3D/dev/acd0 of=3D/dev/ad8 bs=3D2k > > On close, the disk is tasted, and our "geom_cdarch" class finds a > valid CD9660 volume description and attaches to the disk. > > It extracts the image size from the CD9660 descriptor (offset 0x8050, > 32bitLE. Repeated at 0x8054 as 32bitBE) and creates a slice with > this ISO image in it. > > Since there is no valid CD9660 descriptor on the disk right after > this image, the remaining free space gets put into a special > slice ("ad8.freespace"). > > To read in the next ISO image: > > =09dd if=3D/dev/acd0 of=3D/dev/ad8.freespace bs=3D2k > > On close the geom_cdarch class looks for a valid CD9660 volume and > if it finds one, creates a new slice and recreates the freespace > slice with the space now available, and we can repeat the process > until we run out of space. > > Any takers ? > > > -- > 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 incompetenc= e. Question: Will the iso 'fs' be bootable and listed by the boot manager? That is if the iso is a bootable iso image Best regards S=F8ren Soeren Straarup | aka OZ2DAK aka Xride FreeBSD wannabe | FreeBSD since 2.2.6-R Don't let your brain be in idle to long it might get stuck there From owner-freebsd-geom@FreeBSD.ORG Mon Jun 14 14:21:04 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 5128516A4CE for ; Mon, 14 Jun 2004 14:21:04 +0000 (GMT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8045D43D58 for ; Mon, 14 Jun 2004 14:21:03 +0000 (GMT) (envelope-from phk@phk.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 i5EEKf8a094360; Mon, 14 Jun 2004 16:20:41 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: Soeren Straarup From: "Poul-Henning Kamp" In-Reply-To: Your message of "Mon, 14 Jun 2004 16:05:47 +0200." <20040614160301.Y81182-100000@x12.dk> Date: Mon, 14 Jun 2004 16:20:41 +0200 Message-ID: <94359.1087222841@critter.freebsd.dk> cc: geom@freebsd.org Subject: Re: GEOM class idea... 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: Mon, 14 Jun 2004 14:21:04 -0000 In message <20040614160301.Y81182-100000@x12.dk>, Soeren Straarup writes: >Question: Will the iso 'fs' be bootable and listed by the boot manager? >That is if the iso is a bootable iso image No. This is purely meant for "CD-server" use. -- 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. From owner-freebsd-geom@FreeBSD.ORG Mon Jun 14 22:16:52 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 7C15716A4CE for ; Mon, 14 Jun 2004 22:16:52 +0000 (GMT) Received: from spiff.melthusia.org (spiff.melthusia.org [207.67.244.17]) by mx1.FreeBSD.org (Postfix) with ESMTP id 53DC943D4C for ; Mon, 14 Jun 2004 22:16:52 +0000 (GMT) (envelope-from gtetlow@spiff.melthusia.org) Received: from spiff.melthusia.org (gtetlow@localhost [127.0.0.1]) by spiff.melthusia.org (8.12.10/8.12.10) with ESMTP id i5EM9WGc052650; Mon, 14 Jun 2004 15:09:32 -0700 (PDT) (envelope-from gtetlow@spiff.melthusia.org) Received: (from gtetlow@localhost) by spiff.melthusia.org (8.12.10/8.12.10/Submit) id i5EM9VLN052649; Mon, 14 Jun 2004 15:09:31 -0700 (PDT) (envelope-from gtetlow) Date: Mon, 14 Jun 2004 15:09:31 -0700 From: Gordon Tetlow To: Poul-Henning Kamp Message-ID: <20040614220931.GR10016@spiff.melthusia.org> References: <87385.1087146851@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0iexB5Bk8cF8G6DP" Content-Disposition: inline In-Reply-To: <87385.1087146851@critter.freebsd.dk> X-Habeas-SWE-1: winter into spring X-Habeas-SWE-2: brightly anticipated X-Habeas-SWE-3: like Habeas SWE (tm) X-Habeas-SWE-4: Copyright 2002 Habeas (tm) X-Habeas-SWE-5: Sender Warranted Email (SWE) (tm). The sender of this X-Habeas-SWE-6: email in exchange for a license for this Habeas X-Habeas-SWE-7: warrant mark warrants that this is a Habeas Compliant X-Habeas-SWE-8: Message (HCM) and not spam. Please report use of this X-Habeas-SWE-9: mark in spam to . User-Agent: Mutt/1.5.5.1i cc: geom@freebsd.org Subject: Re: GEOM class idea... 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: Mon, 14 Jun 2004 22:16:52 -0000 --0iexB5Bk8cF8G6DP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 13, 2004 at 07:14:11PM +0200, Poul-Henning Kamp wrote: >=20 > OK, here is one of the more nasty ideas for a GEOM class: >=20 > Many of us read CD's into iso images, stick them on a harddisk and > mount them from there when we need to access them. This usually > costs us a md(4) vnode gadget, and that is really a waste. =2E.. description of grotty geom class ... I can't imagine that all the pain that you are talking about is a worthwhile effort when it's so easy to do a md backed file. I can just about guarentee that users will have spare files and capacity before they have a spare disk running around. Maybe I'm missing something here, but what is the advantage of going straight off of the disk? Are you trying to avoid the FFS filesystem overhead? -gordon --0iexB5Bk8cF8G6DP Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAziIbRu2t9DV9ZfsRAo/DAKC9PWuQFQg5hJJyMe0NG661B9wNVQCg0+SR pHPMRmXEs5lCJFvyV+mLHtQ= =0kZK -----END PGP SIGNATURE----- --0iexB5Bk8cF8G6DP-- From owner-freebsd-geom@FreeBSD.ORG Tue Jun 15 05:38: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 1E2DB16A4CE; Tue, 15 Jun 2004 05:38:45 +0000 (GMT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 74ED743D2D; Tue, 15 Jun 2004 05:38:44 +0000 (GMT) (envelope-from phk@phk.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 i5F5cgpg099982; Tue, 15 Jun 2004 07:38:42 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: Gordon Tetlow From: "Poul-Henning Kamp" In-Reply-To: Your message of "Mon, 14 Jun 2004 15:09:31 PDT." <20040614220931.GR10016@spiff.melthusia.org> Date: Tue, 15 Jun 2004 07:38:42 +0200 Message-ID: <99981.1087277922@critter.freebsd.dk> cc: geom@freebsd.org Subject: Re: GEOM class idea... 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: Tue, 15 Jun 2004 05:38:45 -0000 In message <20040614220931.GR10016@spiff.melthusia.org>, Gordon Tetlow writes: >> Many of us read CD's into iso images, stick them on a harddisk and >> mount them from there when we need to access them. This usually >> costs us a md(4) vnode gadget, and that is really a waste. > >=2E.. description of grotty geom class ... > >I can't imagine that all the pain that you are talking about is a >worthwhile effort when it's so easy to do a md backed file. I can >just about guarentee that users will have spare files and capacity >before they have a spare disk running around. > >Maybe I'm missing something here, but what is the advantage of >going straight off of the disk? Are you trying to avoid the FFS >filesystem overhead? You would save both the md and ffs overhead and gain about 10% disk capacity in the process. -- 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. From owner-freebsd-geom@FreeBSD.ORG Thu Jun 17 11:33:39 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 A15E916A4CE for ; Thu, 17 Jun 2004 11:33:39 +0000 (GMT) Received: from imap.univie.ac.at (mailbox-lmtp.univie.ac.at [131.130.1.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 407D743D5A for ; Thu, 17 Jun 2004 11:33:38 +0000 (GMT) (envelope-from l.ertl@univie.ac.at) Received: from pcle2.cc.univie.ac.at (pcle2.cc.univie.ac.at [131.130.2.177]) by imap.univie.ac.at (8.12.10/8.12.10) with ESMTP id i5HBXVWj1160710 for ; Thu, 17 Jun 2004 13:33:33 +0200 Date: Thu, 17 Jun 2004 13:33:31 +0200 (CEST) From: Lukas Ertl To: geom@freebsd.org Message-ID: <20040617132625.A58154@pcle2.cc.univie.ac.at> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-DCC-ZID-Univie-Metrics: imap 4247; Body=1 Fuz1=1 Fuz2=1 Subject: GEOM: orphaning open devices 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, 17 Jun 2004 11:33:39 -0000 Hi GEOM hackers, I have the following scenario: a mirrored setup with two disks and a filesystem on top of it. Now, if I yank one disk while the fs is not mounted, everything works as expected: disk_destroy is called and the orphaning events make their way up. However, if the fs is mounted and I yank the disk, I don't see an orphaning event until the fs is unmounted again, so it seems disk_destroy is blocked or rather g_wither_geom waits until the device is closed, which makes it rather useless in a production area. Is this the intended behaviour? pjd@ suggested calling g_destroy_provider before g_wither_geom in g_destroy_disk. cheers, le -- Lukas Ertl eMail: l.ertl@univie.ac.at UNIX Systemadministrator Tel.: (+43 1) 4277-14073 Vienna University Computer Center Fax.: (+43 1) 4277-9140 University of Vienna http://homepage.univie.ac.at/l.ertl/ From owner-freebsd-geom@FreeBSD.ORG Thu Jun 17 11:37:38 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 8410816A4D9 for ; Thu, 17 Jun 2004 11:37:38 +0000 (GMT) Received: from darkness.comp.waw.pl (darkness.comp.waw.pl [195.117.238.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id 20A3743D48 for ; Thu, 17 Jun 2004 11:37:38 +0000 (GMT) (envelope-from pjd@darkness.comp.waw.pl) Received: by darkness.comp.waw.pl (Postfix, from userid 1009) id B2D60ACAFE; Thu, 17 Jun 2004 13:37:35 +0200 (CEST) Date: Thu, 17 Jun 2004 13:37:35 +0200 From: Pawel Jakub Dawidek To: Lukas Ertl Message-ID: <20040617113735.GM12007@darkness.comp.waw.pl> References: <20040617132625.A58154@pcle2.cc.univie.ac.at> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="YGTp3YEHyFTiE1eD" Content-Disposition: inline In-Reply-To: <20040617132625.A58154@pcle2.cc.univie.ac.at> User-Agent: Mutt/1.4.2i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 5.2.1-RC2 i386 cc: geom@freebsd.org Subject: Re: GEOM: orphaning open devices 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, 17 Jun 2004 11:37:38 -0000 --YGTp3YEHyFTiE1eD Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 17, 2004 at 01:33:31PM +0200, Lukas Ertl wrote: +> Is this the intended behaviour? pjd@ suggested calling g_destroy_provid= er=20 +> before g_wither_geom in g_destroy_disk. Actually s/g_destroy_provider/g_orphan_provider/ :) --=20 Pawel Jakub Dawidek http://www.FreeBSD.org pjd@FreeBSD.org http://garage.freebsd.pl FreeBSD committer Am I Evil? Yes, I Am! --YGTp3YEHyFTiE1eD Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFA0YJ/ForvXbEpPzQRAhIvAJ9ttmKZwMZ4DsIFpu3YUzXHhsFZIACg2cZo HCm1mpjU4jDP5Qxg3aaqNz8= =PMm3 -----END PGP SIGNATURE----- --YGTp3YEHyFTiE1eD-- From owner-freebsd-geom@FreeBSD.ORG Thu Jun 17 11:50:42 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 87E3716A4CE; Thu, 17 Jun 2004 11:50:42 +0000 (GMT) Received: from imap.univie.ac.at (mailbox-lmtp.univie.ac.at [131.130.1.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id CF2BB43D2D; Thu, 17 Jun 2004 11:50:41 +0000 (GMT) (envelope-from le@FreeBSD.org) Received: from pcle2.cc.univie.ac.at (pcle2.cc.univie.ac.at [131.130.2.177]) by imap.univie.ac.at (8.12.10/8.12.10) with ESMTP id i5HBmPA01093884; Thu, 17 Jun 2004 13:48:27 +0200 Date: Thu, 17 Jun 2004 13:48:25 +0200 (CEST) From: Lukas Ertl To: Pawel Jakub Dawidek In-Reply-To: <20040617113735.GM12007@darkness.comp.waw.pl> Message-ID: <20040617134810.X58154@pcle2.cc.univie.ac.at> References: <20040617132625.A58154@pcle2.cc.univie.ac.at> <20040617113735.GM12007@darkness.comp.waw.pl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-DCC-ZID-Univie-Metrics: mx8 4248; Body=2 Fuz1=2 Fuz2=2 cc: geom@FreeBSD.org Subject: Re: GEOM: orphaning open devices 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, 17 Jun 2004 11:50:42 -0000 On Thu, 17 Jun 2004, Pawel Jakub Dawidek wrote: > On Thu, Jun 17, 2004 at 01:33:31PM +0200, Lukas Ertl wrote: > +> Is this the intended behaviour? pjd@ suggested calling g_destroy_provider > +> before g_wither_geom in g_destroy_disk. > > Actually s/g_destroy_provider/g_orphan_provider/ :) Argh... sure :-) cheers, le -- Lukas Ertl http://homepage.univie.ac.at/l.ertl/ le@FreeBSD.org http://people.freebsd.org/~le/ From owner-freebsd-geom@FreeBSD.ORG Thu Jun 17 11:53:38 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 C791A16A4CE for ; Thu, 17 Jun 2004 11:53:38 +0000 (GMT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2975B43D2D for ; Thu, 17 Jun 2004 11:53:38 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost.freebsd.dk [127.0.0.1]) by critter.freebsd.dk (8.12.11/8.12.11) with ESMTP id i5HBq81P018116; Thu, 17 Jun 2004 13:52:08 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: Lukas Ertl From: "Poul-Henning Kamp" In-Reply-To: Your message of "Thu, 17 Jun 2004 13:33:31 +0200." <20040617132625.A58154@pcle2.cc.univie.ac.at> Date: Thu, 17 Jun 2004 13:52:08 +0200 Message-ID: <18115.1087473128@critter.freebsd.dk> Sender: phk@critter.freebsd.dk cc: geom@freebsd.org Subject: Re: GEOM: orphaning open devices 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, 17 Jun 2004 11:53:38 -0000 In message <20040617132625.A58154@pcle2.cc.univie.ac.at>, Lukas Ertl writes: >Hi GEOM hackers, > >I have the following scenario: a mirrored setup with two disks and a >filesystem on top of it. Now, if I yank one disk while the fs is not >mounted, everything works as expected: disk_destroy is called and the >orphaning events make their way up. > >However, if the fs is mounted and I yank the disk, I don't see an >orphaning event until the fs is unmounted again, so it seems disk_destroy >is blocked or rather g_wither_geom waits until the device is closed, which >makes it rather useless in a production area. That is a lot of ground and very little information. the way this is supposed to happen is that you yank the disk, which should orphan geom_disk::whatever and your mirror class should get an orphan event to act on, and de-access and detach your consumer, and that should let the geom_disk::geom wither away. -- 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. From owner-freebsd-geom@FreeBSD.ORG Thu Jun 17 12:13:46 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 92C3716A4CE for ; Thu, 17 Jun 2004 12:13:46 +0000 (GMT) Received: from imap.univie.ac.at (mail.univie.ac.at [131.130.1.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 995F743D55 for ; Thu, 17 Jun 2004 12:13:45 +0000 (GMT) (envelope-from le@FreeBSD.org) Received: from pcle2.cc.univie.ac.at (pcle2.cc.univie.ac.at [131.130.2.177]) by imap.univie.ac.at (8.12.10/8.12.10) with ESMTP id i5HCDB3t1364556; Thu, 17 Jun 2004 14:13:15 +0200 Date: Thu, 17 Jun 2004 14:13:11 +0200 (CEST) From: Lukas Ertl To: Poul-Henning Kamp In-Reply-To: <18115.1087473128@critter.freebsd.dk> Message-ID: <20040617140822.M58154@pcle2.cc.univie.ac.at> References: <18115.1087473128@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-DCC-ZID-Univie-Metrics: imap 4249; Body=2 Fuz1=2 Fuz2=2 cc: geom@FreeBSD.org Subject: Re: GEOM: orphaning open devices 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, 17 Jun 2004 12:13:46 -0000 On Thu, 17 Jun 2004, Poul-Henning Kamp wrote: > In message <20040617132625.A58154@pcle2.cc.univie.ac.at>, Lukas Ertl writes: >> However, if the fs is mounted and I yank the disk, I don't see an >> orphaning event until the fs is unmounted again, so it seems disk_destroy >> is blocked or rather g_wither_geom waits until the device is closed, which >> makes it rather useless in a production area. > > That is a lot of ground and very little information. Ok, here's a trace of that stuff: Filesystem is mounted, and I yank the disk: ciss1: *** Hot-plug drive removed: SCSI port 1 ID 0 ciss1: *** Physical drive failure: SCSI port 1 ID 0 ciss1: *** State change, logical drive 1 ciss1: logical drive 1 (pass1) changed status OK->failed, spare status 0x0 (da1:ciss1:0:1:0): lost device Then I unmount the filesystem: (da1:ciss1:0:1:0): removing device entry g_post_event_x(0xc04b03c0, 0xc2a2d180, 2, -1068613832) g_post_event_x(0xc04b331c, 0xc2a2db00, 2, -1068613832) ref 0xc2a2db00 g_post_event_x(0xc04b331c, 0xc2774600, 2, -1068613832) ref 0xc2774600 g_post_event_x(0xc04b331c, 0xc2a91100, 2, -1068613832) ref 0xc2a91100 g_post_event_x(0xc04b331c, 0xc2935800, 2, -1068613832) ref 0xc2935800 g_post_event_x(0xc04b331c, 0xc2935d00, 2, -1068613832) ref 0xc2935d00 g_post_event_x(0xc04b331c, 0xc23ec200, 2, -1068613832) ref 0xc23ec200 g_post_event_x(0xc04b331c, 0xc2684100, 2, -1068613832) ref 0xc2684100 g_post_event_x(0xc04b331c, 0xc2684f00, 2, -1068613832) ref 0xc2684f00 g_post_event_x(0xc04b331c, 0xc29f7b80, 2, -1068613832) ref 0xc29f7b80 g_post_event_x(0xc04b331c, 0xc2933780, 2, -1068613832) ref 0xc2933780 g_post_event_x(0xc04b331c, 0xc2a91a80, 2, -1068613832) ref 0xc2a91a80 g_wither_geom(0xc2936b00(da1)) g_orphan_provider(0xc2a2db00(da1), 6) g_orphan_register(da1) g_slice_orphan(0xc28381c0/da1) g_wither_geom(0xc2787a80(da1)) g_orphan_provider(0xc2774600(da1s1), 6) g_detach(0xc28381c0) g_destroy_consumer(0xc28381c0) g_dev_orphan(0xc2a08b40(da1)) g_detach(0xc2a08b40) g_wither_geom(0xc2936b00(da1)) g_destroy_geom(0xc2936b00(da1)) g_destroy_consumer(0xc2a08b40) g_destroy_geom(0xc2a90580(da1)) [...] Hm, on closer look it seems the disk controller/driver doesn't let the drive go. cheers, le -- Lukas Ertl http://homepage.univie.ac.at/l.ertl/ le@FreeBSD.org http://people.freebsd.org/~le/ From owner-freebsd-geom@FreeBSD.ORG Thu Jun 17 12:31:09 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 51B7F16A4CE; Thu, 17 Jun 2004 12:31:09 +0000 (GMT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8EA1C43D1D; Thu, 17 Jun 2004 12:31:08 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost.freebsd.dk [127.0.0.1]) by critter.freebsd.dk (8.12.11/8.12.11) with ESMTP id i5HCUuKU018811; Thu, 17 Jun 2004 14:30:56 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: Lukas Ertl From: "Poul-Henning Kamp" In-Reply-To: Your message of "Thu, 17 Jun 2004 14:13:11 +0200." <20040617140822.M58154@pcle2.cc.univie.ac.at> Date: Thu, 17 Jun 2004 14:30:56 +0200 Message-ID: <18810.1087475456@critter.freebsd.dk> Sender: phk@critter.freebsd.dk cc: geom@FreeBSD.org Subject: Re: GEOM: orphaning open devices 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, 17 Jun 2004 12:31:09 -0000 In message <20040617140822.M58154@pcle2.cc.univie.ac.at>, Lukas Ertl writes: >Hm, on closer look it seems the disk controller/driver doesn't let the >drive go. My conclusion too. This is probably because it usually would have paniced the system to do so. -- 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.