Subject: kern/36676: USB stops responding after disconnect while active
To: None <,,>
From: None <>
List: netbsd-bugs
Date: 07/22/2007 11:10:01
>Number:         36676
>Category:       kern
>Synopsis:       USB stops responding after disconnect while active
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jul 22 11:10:00 +0000 2007
>Originator:     Shadi Ammouri
>Release:        NetBSD-portarm-current, NetBSD-i386-current
NetBSD 4.0_BETA2 evbarm
NetBSD 4.0_BETA2 (GENERIC) i386

When disconnecting a USB mass storage device, while the system is performing a write to it, the device becomes unusable (or the system crashes).
On i386 the system crashes.
On ARM systems the device becomes unusable, the drive cannot be unmounted or remounted.
I get the following error: "umount: /dev/sd0c: Input/output error".

When trying to force unmount the device, the system hangs (umount -f).

The USB drive is formatted with FFS.

- mount the USB drive. (mount /dev/sd0c /mnt/disk")
- run dd to write some file to the disk. (dd if=/dev/zero
- disconnect the disk while the write operation is in progress.

Now try to unmount the device.