Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Jul 2007 15:15:13 -0700
From:      "David Schwartz" <davids@webmaster.com>
To:        <idiotbg@gmail.com>
Cc:        freebsd-stable@FreeBSD.org
Subject:   RE: removing external usb hdd without unmounting causes reboot?
Message-ID:  <MDEHLPKNGKAHNMBLJOLKIEKOFHAC.davids@webmaster.com>
In-Reply-To: <20070719.085101.-1860900987.imp@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help


> It won't fix it.  The problem is dangling pointers to devices that no
> longer exist.  And like all dangling references after 'free' you get
> bad thing happening.

> Believe me, if it were easy, it would have been fixed.  If it was
> moderate to fix, it would have been fixed.  It is a hard problem that
> people have put lots of hours into to try to resolve.  To imply
> otherwise is really insulting to all those people (myself include)
> that have tried to fix this.

There is a simple but ugly way to fix it, similar to what the FireWire layer
does. The idea is for the USB layer to create a "device that never goes
away" when it first sees the stick and pass that "device that never goes
away" to the other layers. Even if the storage device is removed, the device
still does not go away.

The virtual device can generate errors if the physical device is missing.
The virtual device can be cleaned up when the device is unmounted. This will
ensure that the 'umount -f' process generates errors (which it will ignore)
rather than crashes (which are somewhat harder to ignore).

DS





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?MDEHLPKNGKAHNMBLJOLKIEKOFHAC.davids>