From owner-freebsd-stable@FreeBSD.ORG Wed Jul 18 19:03:16 2007 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8627316A400 for ; Wed, 18 Jul 2007 19:03:16 +0000 (UTC) (envelope-from josh@tcbug.org) Received: from cenn-smtp.mc.mpls.visi.com (cenn.mc.mpls.visi.com [208.42.156.9]) by mx1.freebsd.org (Postfix) with ESMTP id 5897913C4C9 for ; Wed, 18 Jul 2007 19:03:16 +0000 (UTC) (envelope-from josh@tcbug.org) Received: from mail.tcbug.org (mail.tcbug.org [208.42.70.163]) by cenn-smtp.mc.mpls.visi.com (Postfix) with ESMTP id 3D9348138; Wed, 18 Jul 2007 14:03:15 -0500 (CDT) Received: from [192.168.1.5] (unknown [192.168.2.1]) by mail.tcbug.org (Postfix) with ESMTP id 605E3341C0C; Wed, 18 Jul 2007 14:03:14 -0500 (CDT) From: Josh Paetzel To: Mark Linimon Date: Wed, 18 Jul 2007 14:03:10 -0500 User-Agent: KMail/1.9.6 References: <200707181541.l6IFf4ht051775@lurza.secnetix.de> <20070718170559.GA11915@eos.sc1.parodius.com> <20070718173406.GA16748@soaustin.net> In-Reply-To: <20070718173406.GA16748@soaustin.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3727139.BdYWivcdTr"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200707181403.13410.josh@tcbug.org> Cc: LoN_Kamikaze@gmx.de, freebsd-stable@freebsd.org, Momchil Ivanov Subject: Re: removing external usb hdd without unmounting causes reboot? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2007 19:03:16 -0000 --nextPart3727139.BdYWivcdTr Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Wednesday 18 July 2007, Mark Linimon wrote: > On Wed, Jul 18, 2007 at 10:05:59AM -0700, Jeremy Chadwick wrote: > > Bottom line here is that the kernel panics when removing a USB > > device that has filesystems mounted. > > s/USB // > > > I also have a hard time believing that the reason it hasn't been > > fixed is because "there isn't an easy fix". I'm under the > > impression it hasn't been fixed because either no one cares > > enough to fix it (using the workaround as a scapegoat excuse), or > > because the majority of people do not use USB-based storage > > devices. > > The reason is not the USB stack; the reason (IIRC) is that the > FreeBSD VM was written with the default assumption that Devices > Never Go Away. A large rewrite, I'm told, will be needed to fix > this, and the code is convoluted and tricky. > > No one finds the situation acceptable; introducing the "scapegoat" > word isn't going to win you any support. The problem is not a > weekend's worth of work to fix, nor does it have anything to do > with avoidance by one particular maintainer, which you apparently > had encountered before. > > mcl Panicing really is the right thing to do with the current=20 architecture. Not panicing when a mounted filesystem disappears runs=20 the risk of corrupting other mounted filesystems. Mark is entirely correct, FreeBSD faces an architecture problem here=20 in that the vm and filesystems we have today were not designed in an=20 era when they could just disappear from a running system. The BSD=20 way isn't to apply a quick and dirty little hack to fix=20 the 'problem', it's to design the system properly. And this is=20 assuming a quick and dirty hack even exists. The other problem you're running in to with UFS anyways is that there=20 is no chance to 'unmount' the filesystem when you disconnect the=20 drive. By the time anything has a chance to realize it's gone it's=20 too late. Whether the disk is in the middle of a write, still has=20 buffers to be written out, or is perfectly clean and needs to just be=20 marked as such by the time the OS realizes any of that needs to be=20 done the drive is no longer physically connected to the computer. What might need to happen is a redesign of the vm subsystem so that it=20 can safely deal with mounted filesystems going away, and designing a=20 filesystem that doesn't need to be unmounted specifically for=20 removeable devices. Doesn't sound trivial to me. Or You can just not remove devices with mounted filesystems from your=20 computer..... =2D-=20 Thanks, Josh Paetzel --nextPart3727139.BdYWivcdTr Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQBGnmPxJvkB8SevrssRAlJnAKCKaBjMmBU8d/Po4GVrsTYN5YIk1wCfUO9F T4cSR4SaVS6YdN1vEZ2cNOI= =2U3K -----END PGP SIGNATURE----- --nextPart3727139.BdYWivcdTr--