Date: Sat, 26 Jan 2008 12:54:54 +0100 From: Henrik Gulbrandsen <henrik@gulbra.net> To: linimon@FreeBSD.org Cc: freebsd-usb@FreeBSD.org, oliver@FreeBSD.org Subject: Re: usb/84336: [usb] [reboot] instant system reboot when unmounting a powered off/unplugged+replugged USB device Message-ID: <1201348494.2277.96.camel@Particle> In-Reply-To: <200801260034.m0Q0YVVD012819@freefall.freebsd.org> References: <200801260034.m0Q0YVVD012819@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 2008-01-26 at 00:34 +0000, linimon@FreeBSD.org wrote: > This is a well-known error: there are underlying structures in the kernel > that haven't been made to understand that drives can go away. This > assumption has been false for years. However, the work required is going > to be quite detailed; no quick workarounds are available (they've been > discussed and rejected). So, mark this one as suspended for now. Just out of curiosity: when was this problem last discussed in earnest, what were the suggested workarounds, and why were they rejected? This seems to be a variety of my pet peeve, usb/46176. From what I see, the workaround has been about four patches away most of the time, but I get the feeling that nobody has bothered looking for it, because it has been a well-known "fact" that the solution must involve a full redesign of the underlying subsystems. At least four subsystems are involved here: USB, SCSI, GEOM, and the file system, which would most commonly be the msdosfs in this scenario. The first three of these SHOULD already be handling disappearing drives, but SCSI gets a bit confused when the file system is still around. That was the main problem worked around in the new patch mentioned here: http://lists.freebsd.org/pipermail/freebsd-usb/2007-December/004286.html At this point, only the file systems need to be updated. The cleanest way to handle things may be to have GEOM automatically unmount them at orphaning. Until that's done, however, unmounting from user space via devd seems to be a reasonable approach. Now, I know that this is something of a moving target. There will almost certainly be other problems in this area, for instance when some devices suddenly disappear under high load. That doesn't change the fact that we are slowly getting there. Remember: this bug won't go away until we have the courage to stop running, turn around, and say "boo"! :-) /Henrik
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1201348494.2277.96.camel>