• Jody McIntyre's avatar
    [PATCH] sbp2: fix deadlocks and delays on device removal/rmmod · abd559b1
    Jody McIntyre authored
    Fixes for deadlocks of the ieee1394 and scsi subsystems and long delays in
    futile error recovery attempts when SBP-2 devices are removed or drivers are
    unloaded.
    
     - Complete commands quickly with DID_NO_CONNECT if the 1394 node is gone or if
       the 1394 low-level driver was unloaded.
     - Skip unnecessary work in the eh_abort_handler and eh_device_reset_handler if
       the node or 1394 low-level driver is gone.
     - Let scsi's high-level shut down gracefully when sbp2 is being unloaded or
       detached from the 1394 unit. A call to scsi_remove_device is added for this
       purpose, which requires us to store a scsi_device pointer.
     - scsi_device pointer is obtained from slave_alloc hook and cleared by
       slave_destroy. This avoids usage of the pointer after the scsi device was
       deleted e.g. by the user via scsi_mod's sysfs interface.
    Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
    Signed-off-by: default avatarJody McIntyre <scjody@steamballoon.com>
    Cc: Ben Collins <bcollins@debian.org>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    abd559b1
sbp2.c 82.7 KB