From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:56448 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753310AbbIZRsb (ORCPT ); Sat, 26 Sep 2015 13:48:31 -0400 Subject: Patch "IB/srp: Stop the scsi_eh_ and scsi_tmf_ threads if login fails" has been added to the 4.1-stable tree To: bart.vanassche@sandisk.com, dledford@redhat.com, gregkh@linuxfoundation.org, kkv@clodo.ru, sagig@mellanox.com, sebastian.riemer@profitbricks.com Cc: , From: Date: Sat, 26 Sep 2015 10:48:29 -0700 Message-ID: <144328970925184@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled IB/srp: Stop the scsi_eh_ and scsi_tmf_ threads if login fails to the 4.1-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: ib-srp-stop-the-scsi_eh_-n-and-scsi_tmf_-n-threads-if-login-fails.patch and it can be found in the queue-4.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From bc44bd1d864664f3658352c6aaaa02557d49165d Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 14 Aug 2015 11:01:09 -0700 Subject: IB/srp: Stop the scsi_eh_ and scsi_tmf_ threads if login fails From: Bart Van Assche commit bc44bd1d864664f3658352c6aaaa02557d49165d upstream. scsi_host_alloc() not only allocates memory for a SCSI host but also creates the scsi_eh_ kernel thread and the scsi_tmf_ workqueue. Stop these threads if login fails by calling scsi_host_put(). Reported-by: Konstantin Krotov Fixes: fb49c8bbaae7 ("Remove an extraneous scsi_host_put() from an error path") Signed-off-by: Bart Van Assche Cc: Sagi Grimberg Cc: Sebastian Parschauer Signed-off-by: Doug Ledford Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/ulp/srp/ib_srp.c | 9 +++++++++ 1 file changed, 9 insertions(+) --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -2761,6 +2761,13 @@ static int srp_sdev_count(struct Scsi_Ho return c; } +/* + * Return values: + * < 0 upon failure. Caller is responsible for SRP target port cleanup. + * 0 and target->state == SRP_TARGET_REMOVED if asynchronous target port + * removal has been scheduled. + * 0 and target->state != SRP_TARGET_REMOVED upon success. + */ static int srp_add_target(struct srp_host *host, struct srp_target_port *target) { struct srp_rport_identifiers ids; @@ -3299,6 +3306,8 @@ out: mutex_unlock(&host->add_target_mutex); scsi_host_put(target->scsi_host); + if (ret < 0) + scsi_host_put(target->scsi_host); return ret; Patches currently in stable-queue which might be from bart.vanassche@sandisk.com are queue-4.1/ib-srp-stop-the-scsi_eh_-n-and-scsi_tmf_-n-threads-if-login-fails.patch queue-4.1/ib-srp-handle-partial-connection-success-correctly.patch