scsi_transport_srp: Fix fast_io_fail_tmo=dev_loss_tmo=off behavior
authorBart Van Assche <bvanassche@acm.org>
Wed, 9 Jul 2014 13:56:43 +0000 (15:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Sep 2014 16:19:14 +0000 (09:19 -0700)
commit6c4e8e0a0108f8cc9095a4e23df75b1873f59c31
treec653f9a71ef0965a9539790d5d323277a3c124b3
parentaeed424c53c76baac72c10892b10c3bfc5ffb5ee
scsi_transport_srp: Fix fast_io_fail_tmo=dev_loss_tmo=off behavior

commit cd53eb686d2418eda938aad3c9da42b7dfa9351f upstream.

If scsi_remove_host() is called while an rport is in the blocked state
then scsi_remove_host() will only finish if the rport is unblocked
from inside a timer function. Make sure that an rport only enters the
blocked state if a timer will be started that will unblock it. This
avoids that unloading the ib_srp kernel module after having
disconnected the initiator from the target system results in a
deadlock if both the fast_io_fail_tmo and dev_loss_tmo parameters have
been set to "off".

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
Reviewed-by: David Dillow <dave@thedillows.org>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/scsi_transport_srp.c