>Number: 128847
>Category: usb
>Synopsis: Detachment of mounted USB flash drive causes system freeze
>Confidential: no
>Severity: serious
>Priority: low
>Responsible:freebsd-usb
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Thu Nov 13 18:10:06 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator: Patrick
>Release:7.0
>Organization:
>Environment:
FreeBSD hostname 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Sun Feb 24 19:59:52 UTC
2008 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/GENERIC i386
>Description:
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.
>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: 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: 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
>Fix:
Patch attached with submission follows:
Copyright (c) 1992-2008 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 7.0-RELEASE #0: Sun Feb 24 19:59:52 UTC 2008
[EMAIL PROTECTED]:/usr/obj/usr/src/sys/GENERIC
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: Intel(R) Pentium(R) 4 CPU 2.40GHz (1202.73-MHz 686-class CPU)
Origin = "GenuineIntel" Id = 0xf29 Stepping = 9
Features=0xbfebfbff
Features2=0x4400
Logical CPUs per core: 2
real memory = 536805376 (511 MB)
avail memory = 503001088 (479 MB)
ACPI APIC Table:
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
cpu0 (BSP): APIC ID: 0
cpu1 (AP): APIC ID: 1
ioapic0: Changing APIC ID to 2
ioapic0 irqs 0-23 on motherboard
kbd1 at kbdmux0
ath_hal: 0.9.20.3 (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413, RF5413)
hptrr: HPT RocketRAID controller driver v1.1 (Feb 24 2008 19:59:27)
acpi0: on motherboard
acpi0: [ITHREAD]
acpi0: Power Button (fixed)
acpi0: reservation of 0, a (3) failed
acpi0: reservation of 10, 1fef (3) failed
Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x408-0x40b on acpi0
cpu0: on acpi0
p4tcc0: on cpu0
cpu1: on acpi0
p4tcc1: on cpu1
acpi_button0: on acpi0
pcib0: port 0xcf8-0xcff on acpi0
pci0: on pcib0
agp0: on hostb0
pcib1: at device 1.0 on pci0
pci1: on pcib1
nvidia0: mem 0xf000-0xf0ff,0xe800-0xefff irq
16 at device 0.0 on pci1
nvidia0: [GIANT-LOCKED]
nvidia0: [ITHREAD]
uhci0: port 0xac00-0xac1f irq 16 at
device 29.0 on pci0
uhci0: [GIANT-LOCKED]
uhci0: [ITHREAD]
usb0: on uhci0
usb0: USB revision 1.0
uhub0: on usb0
uhub0: 2 ports with 2 removable, self powered
uhci1: port 0xa000-0xa01f irq 19 at
device 29.1 on pci0
uhci1: [GIANT-LOCKED]
uhci1: [ITHREAD]
usb1: on uhci1
usb1: USB revision 1.0
uhub1: on usb1
uhub1: 2 ports with 2 removable, self powered
uhci2: port 0xa400-0xa41f irq 18 at
device 29.2 on pci0
uhci2: [GIANT-LOCKED]
uhci2: [ITHREAD]
usb2: on uhci2
usb2: USB revision 1.0
uhub2: on usb2
uhub2: 2 ports with 2 removable, self powered
uhci3: port 0xa800-0xa81f irq 16 at
device 29.3 on pci0
uhci3: [GIANT-LOCKED]
uhci3: [ITHREAD]
usb3: on uhci3
usb3: USB revision 1.0
uhub3: on usb3
uhub3: 2 ports with 2 removable, self powered
ehci0: mem 0xf400-0xf40003ff
irq 23 at device 29.7 on pci0
ehci0: [GIANT-LOCKED]
ehci0: [ITHREAD]
usb4: EHCI version 1.0
usb4: companion controllers, 2 ports each: usb0 usb1 usb2 usb3
usb4: on ehci0
usb4: USB revision 2.0
uhub4: on usb4
uhub4: 8 ports with 8 removable, self powered
pcib2: at device 30.0 on pci0
pci2: on pcib2
fwohci0: mem
0xf3005000-0xf30057ff,0xf300-0xf3003fff irq 17 at device 1.0 on pci2
fwohci0: [FILTER]
fwohci0: OHCI version 1.10 (ROM=1)
fwohc