From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bart Van Assche Subject: Re: [PATCH 0/5] SRP initiator patches for kernel 3.17 Date: Thu, 03 Jul 2014 16:19:04 +0200 Message-ID: <53B56658.1080609@acm.org> References: <53B55E55.5040907@acm.org> <53B565EB.50301@acm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <53B565EB.50301-HInyCGIudOg@public.gmane.org> Sender: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Roland Dreier Cc: James Bottomley , Sagi Grimberg , Sebastian Parschauer , David Dillow , linux-rdma , "linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" List-Id: linux-rdma@vger.kernel.org (CC'ing linux-scsi) On 07/03/14 15:45, Bart Van Assche wrote:> 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 > Cc: James Bottomley > Cc: Sagi Grimberg > Cc: Sebastian Parschauer > Cc: David Dillow > Cc: > --- > drivers/scsi/scsi_transport_srp.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/scsi/scsi_transport_srp.c b/drivers/scsi/scsi_transport_srp.c > index 13e8983..a0c5bfd 100644 > --- a/drivers/scsi/scsi_transport_srp.c > +++ b/drivers/scsi/scsi_transport_srp.c > @@ -473,7 +473,8 @@ static void __srp_start_tl_fail_timers(struct srp_rport *rport) > if (delay > 0) > queue_delayed_work(system_long_wq, &rport->reconnect_work, > 1UL * delay * HZ); > - if (srp_rport_set_state(rport, SRP_RPORT_BLOCKED) == 0) { > + if ((fast_io_fail_tmo >= 0 || dev_loss_tmo >= 0) && > + srp_rport_set_state(rport, SRP_RPORT_BLOCKED) == 0) { > pr_debug("%s new state: %d\n", dev_name(&shost->shost_gendev), > rport->state); > scsi_target_block(&shost->shost_gendev); > -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html