]> git.baikalelectronics.ru Git - kernel.git/commit
firewire: fw-sbp2: don't add scsi_device twice
authorStefan Richter <stefanr@s5r6.in-berlin.de>
Sun, 3 Feb 2008 22:10:47 +0000 (23:10 +0100)
committerStefan Richter <stefanr@s5r6.in-berlin.de>
Sat, 16 Feb 2008 14:40:35 +0000 (15:40 +0100)
commitbf46527493546013488f4a1ceb368f23d9e910ee
tree3fac0c712c15107247c029f1802673e6553e57b7
parent19eca139e830dcb80c4c8500ce6041cb2ec5387f
firewire: fw-sbp2: don't add scsi_device twice

When a reconnect failed but re-login succeeded, __scsi_add_device was
called again.

In those cases, __scsi_add_device succeeded and returned the pointer to
the existing scsi_device.  fw-sbp2 then continued orderly, except that
it missed to call sbp2_cancel_orbs.  SCSI core would call fw-sbp2's
eh_abort_handler eventually if there had been an outstanding command.

This patch avoids the needless lookups and temporary allocations in SCSI
core and I/O stall and timeout until eh_abort_handler hits.

Also, __scsi_add_device tolerating calls for devices which already exist
is undocumented behavior on which we shouldn't rely.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Jarod Wilson <jwilson@redhat.com>
drivers/firewire/fw-sbp2.c