Bug 140356 - SCSI subsystem locks up when unplugging external firewire devices
SCSI subsystem locks up when unplugging external firewire devices
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
All Linux
medium Severity high
: ---
: ---
Assigned To: Dave Jones
Depends On:
  Show dependency treegraph
Reported: 2004-11-22 11:14 EST by Didier
Modified: 2015-01-04 17:12 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-12-07 02:57:59 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
/var/log/messages (2.60 KB, text/plain)
2004-11-22 11:16 EST, Didier
no flags Details
dmesg attach/detach log extract (689 bytes, text/plain)
2004-11-22 11:18 EST, Didier
no flags Details

  None (edit)
Description Didier 2004-11-22 11:14:06 EST
Description of problem:

Physically detaching an external IEEE1394 device (DVD-writer) by e.g.
unplugging the firewire cable causes the kernel scsi subsystem to
completely lock up (no dmesg, no oopses).

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. attach external SCSI device, watch udev create links
2. remove external SCSI device
3. cat /proc/scsi/scsi

Actual results:
SCSI-related processes (cat /proc/scsi/scsi, rmmod sbp2, etc.) hang.

root     10801  0.0  0.0  3700  412 pts/6    D+   17:06   0:00 cat
root     11235  0.0  0.0  1436  380 pts/7    D+   17:11   0:00 rmmod sbp2

Additional info:
- Could this be related to bug #136255 ?
- udev creates symlinks in /dev, but not in /media (bug #139171 ?).
Comment 1 Didier 2004-11-22 11:16:48 EST
Created attachment 107186 [details]

Nov 22 17:03:05  :  attach firewire device
Nov 22 17:06:01  :  detach firewire device
Comment 2 Didier 2004-11-22 11:18:13 EST
Created attachment 107187 [details]
dmesg attach/detach log extract
Comment 3 Didier 2004-11-28 14:17:14 EST
"rmmod sbp2" while the IEEE1394 device is still atached, yields the
same erroneous behaviour (= scsi subsystem lockup).

1. in console :

# rmmod sbp2
(the console hangs)

2. in another console :

# tail /var/log/messages
Nov 28 20:16:16 dmbr042 kernel: ieee1394: sbp2: Logged out of SBP-2 device
Nov 28 20:16:16 dmbr042 udev[8249]: removing device node '/dev/scd0'

# ps aux
root      8235  0.0  0.0  1436  380 pts/5    D+   20:16   0:00 rmmod sbp2

--> SCSI locked up until next reboot.
Comment 4 Didier 2004-12-08 04:13:19 EST
SCSI subsystem still locking up with kernel-2.6.9-1.698_FC3.
Comment 5 Dave Jones 2004-12-08 12:21:19 EST
what a surprise, the firewire subsystem didnt improve with age.
I've picked up a firewire device myself, so I might tackle this at
some point in the future, but it's not top of my todo list.

Reporting this problem to the upstream ieee1394 developers might be
useful for you in the meantime.
Comment 6 Didier 2004-12-08 15:18:25 EST
I'll report upstream, and refer to this bug report.

Please note firewire is sometimes the only high-speed alternative for
(slightly aging) laptops without USB2.

PCMCIA USB2 could be a solution for non-camera (e.g. storage) devices,
but I noticed random device disconnections with the latest
kernel-2.6.9-1.698_FC3 (would not know how to further diagnose and put
this in a bug report, though).
Comment 7 Didier 2005-05-24 05:24:45 EDT
Unfortunately, this bug did not disappear magically : still present with FC4t3

Seems I'll really have to report upstream.  ;)

(for the record : SATA drive /dev/sda keeps functioning, newly attached USB keys
are not recognized.)
Comment 8 Bradd W. Szonye 2005-05-31 09:25:40 EDT
I'm seeing the same symptoms with 2.6.11-1.1363_FC4smp. Specifically, I'm seeing
the problem reported on the "IEEE 1394 for Linux" sourceforge project, bug
number 1008416. After unplugging my Macally AC100, dmesg usually shows
"Synchronizing SCSI cache for disk sdd:" after which anything depending on
/proc/scsi/scsi will hang. I did manage to replug the device once or twice, but
the problem almost always manifests after unplugging.

Once the problem occurs, "cat /proc/scsi/scsi" not only hangs, it results in an
unkillable process. Furthermore, the system hangs during shutdown, again with
the message "Synchronizing SCSI cache for disk sdd:".
Comment 9 John Flynn 2005-06-15 15:28:05 EDT
I used to see this too.

I actually had to compile my own custom kernel with the "Synchronizing SCSI
cache" code commented out to "solve" this problem. Since I did that, no more
lockups; firewire works beautifully.

I believe the "Synchronizing SCSI cache" message and code is for RAID
controllers that have onboard delayed-write caching; it ensures that any pending
writes are completed before power is cut. This is obviously pointless for
external firewire drives, as once the drive is unplugged, it's physically gone
and no amount of attempting to synchronize will help.

I hope this is fixed soon; firewire disks under Linux are effectively broken
with this bug!

Comment 10 Dave Jones 2005-07-15 16:21:55 EDT
An update has been released for Fedora Core 3 (kernel-2.6.12-1.1372_FC3) which
may contain a fix for your problem.   Please update to this new kernel, and
report whether or not it fixes your problem.

If you have updated to Fedora Core 4 since this bug was opened, and the problem
still occurs with the latest updates for that release, please change the version
field of this bug to 'fc4'.

Thank you.
Comment 11 Bradd W. Szonye 2005-08-16 21:21:28 EDT
I don't have easy access to Fedora Core 3, but I did update to Fedora Core 4
(2.6.12-1.1398_FC4smp). I haven't yet noticed the "Synchronizing SCSI ..."
message yet, but I'm still having the same basic problem: reading
/proc/scsi/scsi hangs the process unkillably, and re-plugging is not possible.
(I'm not the owner, so I can't update the version field.)
Comment 12 Dave Jones 2005-12-07 02:57:59 EST
This bug has been mass-closed along with all other bugs that
have been in NEEDINFO state for several months.

Due to the large volume of inactive bugs in bugzilla, this
is the only method we have of cleaning out stale bug reports
where the reporter has disappeared.

If you can reproduce this bug with current FC3 updates, please
reopen this bug.

If you are not the reporter, you can add a comment requesting
it be reopened, and someone will get to it asap.

If you are not the reporter, but can reproduce this problem against
FC4, please open a new bug.

Thank you.

Note You need to log in before you can comment on or make changes to this bug.