]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.16.3/scsi_transport_srp-fix-fast_io_fail_tmo-dev_loss_tmo-off-behavior.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.16.3 / scsi_transport_srp-fix-fast_io_fail_tmo-dev_loss_tmo-off-behavior.patch
1 From cd53eb686d2418eda938aad3c9da42b7dfa9351f Mon Sep 17 00:00:00 2001
2 From: Bart Van Assche <bvanassche@acm.org>
3 Date: Wed, 9 Jul 2014 15:56:43 +0200
4 Subject: scsi_transport_srp: Fix fast_io_fail_tmo=dev_loss_tmo=off behavior
5
6 From: Bart Van Assche <bvanassche@acm.org>
7
8 commit cd53eb686d2418eda938aad3c9da42b7dfa9351f upstream.
9
10 If scsi_remove_host() is called while an rport is in the blocked state
11 then scsi_remove_host() will only finish if the rport is unblocked
12 from inside a timer function. Make sure that an rport only enters the
13 blocked state if a timer will be started that will unblock it. This
14 avoids that unloading the ib_srp kernel module after having
15 disconnected the initiator from the target system results in a
16 deadlock if both the fast_io_fail_tmo and dev_loss_tmo parameters have
17 been set to "off".
18
19 Signed-off-by: Bart Van Assche <bvanassche@acm.org>
20 Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
21 Reviewed-by: David Dillow <dave@thedillows.org>
22 Signed-off-by: Roland Dreier <roland@purestorage.com>
23 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24
25 ---
26 drivers/scsi/scsi_transport_srp.c | 3 ++-
27 1 file changed, 2 insertions(+), 1 deletion(-)
28
29 --- a/drivers/scsi/scsi_transport_srp.c
30 +++ b/drivers/scsi/scsi_transport_srp.c
31 @@ -473,7 +473,8 @@ static void __srp_start_tl_fail_timers(s
32 if (delay > 0)
33 queue_delayed_work(system_long_wq, &rport->reconnect_work,
34 1UL * delay * HZ);
35 - if (srp_rport_set_state(rport, SRP_RPORT_BLOCKED) == 0) {
36 + if ((fast_io_fail_tmo >= 0 || dev_loss_tmo >= 0) &&
37 + srp_rport_set_state(rport, SRP_RPORT_BLOCKED) == 0) {
38 pr_debug("%s new state: %d\n", dev_name(&shost->shost_gendev),
39 rport->state);
40 scsi_target_block(&shost->shost_gendev);