From owner-freebsd-current@FreeBSD.ORG Wed Aug 31 13:13:23 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A514516A41F for ; Wed, 31 Aug 2005 13:13:23 +0000 (GMT) (envelope-from anderson@centtech.com) Received: from mh2.centtech.com (moat3.centtech.com [207.200.51.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4BB2A43D45 for ; Wed, 31 Aug 2005 13:13:23 +0000 (GMT) (envelope-from anderson@centtech.com) Received: from [10.177.171.220] (neutrino.centtech.com [10.177.171.220]) by mh2.centtech.com (8.13.1/8.13.1) with ESMTP id j7VDDMVP051828; Wed, 31 Aug 2005 08:13:22 -0500 (CDT) (envelope-from anderson@centtech.com) Message-ID: <4315AD00.70809@centtech.com> Date: Wed, 31 Aug 2005 08:13:36 -0500 From: Eric Anderson User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.10) Gecko/20050815 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Daniel O'Connor" References: <1125452228.740.3.camel@arbitor.homelinux.com> <200508311306.46876.doconnor@gsoft.com.au> <4315A757.5020108@centtech.com> <200508312230.20301.doconnor@gsoft.com.au> In-Reply-To: <200508312230.20301.doconnor@gsoft.com.au> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org Subject: Re: panic after removing usb flash drive X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2005 13:13:23 -0000 Daniel O'Connor wrote: > On Wednesday 31 August 2005 22:19, Eric Anderson wrote: > >>>Although last time I saw this discussed I came away with the impression >>>that it wasn't possible for the kernel to do this..? (without substantial >>>work anyway) >> >>Why not just use the automounter to mount/umount this for you? This >>probably won't get around umounting while in use, but you might be able >>to tell amd to use a umount -f on it. > > > I would have thought you'd still get a panic anyway..? > The VM will try and flush the dirty pages when you umount and consequently > panic. My thinking was that amd would auto-unmount the filesystem when it isn't being used, and if the timeout is set low (I think the default is 5 minutes), then once done using the flash, it would have time to umount before it was unplugged. Now that I think about it though, if he is using it (and open files), it won't even attempt to unmount it anyhow. This is where I think it would be great to have a sort of 'flashfs' - something like a UFS2 filesystem, but read only until a write happens, and all writes would be synchronous, and after the write occurs, the fs goes back to a 'read only' state. Maybe this could be done with gjournal or even unionfs - mount the usb flash read only, do all writes to a memory backed disk, and then flush the writes out to the usb flash periodically. Not perfect, but maybe this will stir some ideas up. Eric -- ------------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology Anything that works is better than anything that doesn't. ------------------------------------------------------------------------