Bug 128847

Summary: Detachment of mounted USB flash drive causes system freeze
Product: Base System Reporter: Patrick <wwmpcdd>
Component: usbAssignee: Mark Linimon <linimon>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.txt none

Description Patrick 2008-11-13 18:10:06 UTC
When I manually detach my USB flash drive that contains files in use on the system in question without umounting it, and then re-attach it, my system freezes.

Fix: Patch attached with submission follows:
How-To-Repeat: Mount the USB flash drive. Open one of the files located on the drive with a program such as Opera or leafpad (what I did). Manually remove the USB flash drive. Reinsert the flash drive.

I then tried to save the file I had opened in leafpad, and it told me it could not open the file for saving. I opened up a terminal and ran 'su', and that's when my system froze. /var/log/messages showed this:

Nov 13 17:16:10  kernel: GEOM_LABEL: Label msdosfs/WWMPCDD_USB removed.
Nov 13 17:45:23  kernel: umass0: at uhub4 port 5 (addr 2) disconnected
Nov 13 17:45:23  kernel: (da0:umass-sim0:0:0:0): lost device
Nov 13 17:45:23  kernel: umass0: detached
Nov 13 17:45:54  kernel: umass0: <SanDisk Corporation Cruzer Mini, class 0/0, rev 2.00/0.10, addr 2> on uhub4
Nov 13 17:45:54  root: Unknown USB device: vendor 0x0781 product 0x5150 bus uhub4
Nov 13 17:45:55  kernel: da1 at umass-sim0 bus 0 target 0 lun 0
Nov 13 17:45:55  kernel: da1: <SanDisk Cruzer Mini 0.1> Removable Direct Access SCSI-2 device 
Nov 13 17:45:55  kernel: da1: 40.000MB/s transfers
Nov 13 17:45:55  kernel: da1: 244MB (501759 512 byte sectors: 64H 32S/T 244C)
Nov 13 17:45:55  kernel: GEOM_LABEL: Label for provider da1s1 is msdosfs/WWMPCDD_USB.
Nov 13 17:45:58  kernel: g_vfs_done():da0s1[WRITE(offset=22452224, length=2048)]error = 6
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2008-12-25 03:41:36 UTC
State Changed
From-To: open->closed

Well-known problem; see, for instance, 
http://people.freebsd.org/~linimon/studies/prs/well_known_prs.html. 


Comment 2 Mark Linimon freebsd_committer freebsd_triage 2008-12-25 03:41:36 UTC
Responsible Changed
From-To: freebsd-usb->linimon