removing external usb hdd without unmounting causes reboot?
Josh Paetzel
josh at tcbug.org
Wed Jul 18 19:03:16 UTC 2007
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
architecture. Not panicing when a mounted filesystem disappears runs
the risk of corrupting other mounted filesystems.
Mark is entirely correct, FreeBSD faces an architecture problem here
in that the vm and filesystems we have today were not designed in an
era when they could just disappear from a running system. The BSD
way isn't to apply a quick and dirty little hack to fix
the 'problem', it's to design the system properly. And this is
assuming a quick and dirty hack even exists.
The other problem you're running in to with UFS anyways is that there
is no chance to 'unmount' the filesystem when you disconnect the
drive. By the time anything has a chance to realize it's gone it's
too late. Whether the disk is in the middle of a write, still has
buffers to be written out, or is perfectly clean and needs to just be
marked as such by the time the OS realizes any of that needs to be
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
can safely deal with mounted filesystems going away, and designing a
filesystem that doesn't need to be unmounted specifically for
removeable devices. Doesn't sound trivial to me.
Or
You can just not remove devices with mounted filesystems from your
computer.....
--
Thanks,
Josh Paetzel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20070718/cf50995a/attachment.pgp
More information about the freebsd-stable
mailing list