Matthias Buelow
2005-Apr-09 09:59 UTC
suboptimal handling of accidentally pulled usb devices (5.4)
Hi folks, every so often, I forget to unmount my ipod (usb2) before pulling it from my PC. While this and the mess that ensues is clearly a user error, it would be nice if this exceptional situation would get handled a bit more gracefully by the OS. What happens now is that I cannot use the device anymore ("Resource unavailable") until I reboot. Trying to unmount the still mounted filesystem (no matter if the device is plugged back in or not) simply gives: Apr 9 18:43:44 drjekyll kernel: fsync: giving up on dirty: 0xc305ca50: tag msdo sfs, type VREG, usecount 1, writecount 0, refcount 1, flags (VV_OBJBUF), lock ty pe msdosfs: EXCL (count 1) by thread 0xc2d3ce10 (pid 3332) Apr 9 18:43:44 drjekyll kernel: startcluster 7400, dircluster 38092, diroffset 320, on dev (4, 30) I see two problems here: 1) If the OS notices that the (removable) device has disappeared, can't it just throw away the remaining buffers? I guess trying to write the remaining buffers if the device is reinserted is a no-option, since the state of the intermittently removed device is unknown. But clearly, just insisting on keeping the buffers without any chance of ever writing them back is not correct behaviour (and I guess will cause problems at shutdown, haven't checked that now). 2) Umount -f completely froze the machine and I had to powercycle. This probably should be fixed. This is on 5.4-PRERELEASE/i386, using ehci for the usb2 device. More info available on request. mkb.
Gerrit Kühn
2005-Apr-09 11:34 UTC
suboptimal handling of accidentally pulled usb devices (5.4)
On Sat, Apr 09, 2005 at 07:00:38PM +0200, Matthias Buelow wrote:> This is on 5.4-PRERELEASE/i386, using ehci for the usb2 device. > More info available on request.I see exactly the same behaviour here with an iRiver iFP player on 5.4-STABLE/i386, and I'd appreciate improvements in this field, too. ;) cu Gerrit --
Doug White
2005-Apr-12 09:07 UTC
suboptimal handling of accidentally pulled usb devices (5.4)
On Sat, 9 Apr 2005, Matthias Buelow wrote:> every so often, I forget to unmount my ipod (usb2) before pulling it > from my PC. While this and the mess that ensues is clearly a user > error, it would be nice if this exceptional situation would get handled > a bit more gracefully by the OS. What happens now is that I cannot use > the device anymore ("Resource unavailable") until I reboot. Trying to > unmount the still mounted filesystem (no matter if the device is plugged > back in or not) simply gives:Please see the archives for a lenghty explanation of why this is not going to be fixed in the near-term future. -- Doug White | FreeBSD: The Power to Serve dwhite@gumbysoft.com | www.FreeBSD.org