Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 136255
Summary: | USB devices hang programs if pulled out on an open() | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | John (J5) Palmieri <johnp> | ||||||||||
Component: | kernel | Assignee: | Pete Zaitcev <zaitcev> | ||||||||||
Status: | CLOSED UPSTREAM | QA Contact: | |||||||||||
Severity: | high | Docs Contact: | |||||||||||
Priority: | medium | ||||||||||||
Version: | rawhide | CC: | crlb, cwilcox, davej, davidz, d.bz-redhat, ed, jkeck, linhardt, mhuhtala, moneta.mace, rob.kirkbride, sbangert, sbergman, tim-t2, wtogami | ||||||||||
Target Milestone: | --- | ||||||||||||
Target Release: | --- | ||||||||||||
Hardware: | All | ||||||||||||
OS: | Linux | ||||||||||||
Whiteboard: | |||||||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||||||
Doc Text: | Story Points: | --- | |||||||||||
Clone Of: | Environment: | ||||||||||||
Last Closed: | 2006-02-15 18:03:10 UTC | Type: | --- | ||||||||||
Regression: | --- | Mount Type: | --- | ||||||||||
Documentation: | --- | CRM: | |||||||||||
Verified Versions: | Category: | --- | |||||||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||||||
Embargoed: | |||||||||||||
Bug Depends On: | |||||||||||||
Bug Blocks: | 165247 | ||||||||||||
Attachments: |
|
Description
John (J5) Palmieri
2004-10-18 22:01:35 UTC
Created attachment 105403 [details]
Test program
Created attachment 105450 [details]
Kernel backtrace
Backtrace of test program after it hangs.
*** Bug 138259 has been marked as a duplicate of this bug. *** Have an identical problem using RedHat Fedora Core 2, with a 2.6.9 kernel. My program polls for USB device insertion and removal by opening /dev/sda, /dev/sdb, etc. I tried with and without O_NONBLOCK, and it hangs intermittently (but often) either way on device removal. Is there a better way to detect insertion and removal events without polling? I actually think the problem is worse than this. If the device is unmounted rather than being ejected it produces a hang in the hal daemon (presumably the same hang as above). This was a suggestion by Kay Siever on the hot plug mailling list and appears to work. ie. This isn't just about pulling the key out out. The problem is if you forget to do the eject rather than the unmount, your USB bus effectively locks up requiring a reboot.
> I actually think the problem is worse than this. [...]
Yes, that is also what I reported in my original bug. That bug
(138259) got resolved as a duplicate of this one.
Mikko
I have seen the same thing. 1)Plug in a USB key drive. Drive is mounted and shows up on desktop. 2)Right click and click Unmount volume. Driver icon goes away. 3) Remove drive. 4) Plug drive in again. Drive is mounted and shows up on desktop. 5) Right click and click Unmount volume. Error message that the device is busy. 6) Remove device. Icon goes away. 7) Plug drive in a third time, nothing happens. Sorry, I should have mentioned that this is on Fedora Core 3 kernel v. 2.6.9-1.681_FC3 Mark Levitt, I think that is a different bug alltogether. It looks more like bug #132572. Certant USB devices break the massstorage drivers. *** Bug 140964 has been marked as a duplicate of this bug. *** *** Bug 138906 has been marked as a duplicate of this bug. *** Any relation to bug #140356 (SCSI subsystem lockup when removing IEEE1394 devices) ? I have tried Kernel 2.6.9-RC2 and it works fine with FC3. It mounts devices etc. as it should and the hal daemon appears to does its job correctly. I've been running it for a few so far and it's been fine. Hopefully an offical kernel update can be issued with at least the USB corrections from RC2 in. My kernel is 2.6.9-1.681_FC3 and the problem persists. I just rebooted and unplugged, plugged my 64MB CF card into my Dazzle* 8-in-1 High Speed USB 2.0 reader and it recognized it when I first started gnome, and it found it again when I unplugged, plugged, but then when I tried it again it fails to recognize it. Logging out and logging back in does not help. Nor does restarting haldaemon. Only a reboot gets it "working" again. Though only for a very short time until it fails again. Card readers are polled by HAL to detect media insertion. This involves an open() so if you pull the card out while the reader is being polled the system call hangs. Created attachment 107913 [details] Oops in SCSI subsystem As a follow-up to my own comment #12, "cat /proc/scsi/sci" hangs too after some detach/attach cycles, same behaviour as bug #140356 (where SCSI hangs after one detach, reproducable). Contrary to bug #140356, I do get an oops here (see attachment). Problem persists with 2.6.9-1.715_FC3 : detaching and reattaching a digicam (Pentax Optio 750Z) to the USB port hangs the SCSI subsystem, requiring a reboot to restore USB and/or Firewire operations (my FC2 uptimes of 20+ days are decimated). root 29 0.0 0.0 0 0 ? D 12:49 0:00 [khubd] root 3940 0.0 0.9 8916 7196 ? Ds 12:51 0:02 hald didier 7822 0.2 1.6 24556 12516 ? D 13:31 0:04 /usr/bin/gtkam didier 8031 0.2 3.9 125004 30600 ? Dl 13:32 0:03 gthumb root 8658 0.0 0.0 0 0 ? D 13:37 0:00 [scsi_eh_1] root 8659 0.0 0.0 0 0 ? S 13:37 0:00 [usb-storage] root 8993 0.0 0.0 3812 636 pts/6 D+ 13:38 0:00 fdisk -l Created attachment 108855 [details]
USB detach/reattach syslog
After syncing and detaching, udev removes SCSI node, and kernel reports scsi &
FAT I/O errors.
After reattaching, udev recreates sda node, but hal times out.
*** Bug 143785 has been marked as a duplicate of this bug. *** *** Bug 152308 has been marked as a duplicate of this bug. *** |