IB/srp: Stop the scsi_eh_<n> and scsi_tmf_<n> threads if login fails
Subsystems (2)
PATCH 1/1 IB/srp: Stop the scsi_eh_<n> and scsi_tmf_<n> threads if login fails
scsi_host_alloc() not only allocates memory for a SCSI host but also creates the scsi_eh_<n> kernel thread and the scsi_tmf_<n> workqueue. Stop these threads if login fails by calling scsi_host_put().
Reported-by Konstantin Krotov <[email protected]>
Fixes fb49c8bbaae7 ("Remove an extraneous scsi_host_put() from an error path")
Signed-off-by Bart Van Assche <[email protected]>
Cc Sagi Grimberg <sagig-VPRAkNaXOzVWk0Htik3J/[email protected]>
Cc Sebastian Parschauer <[email protected]>
Cc <[email protected]> #v3.19
--- drivers/infiniband/ulp/srp/ib_srp.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/infiniband/ulp/srp/ib_srp.c +9 -0
@@ -2765,6 +2765,13 @@ static int srp_sdev_count(struct Scsi_Host *host)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;
@@ -3303,6 +3310,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;
Signature · 6 lines
2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 10 lines · Bart Van Assche
scsi_host_alloc()not only allocates memory for a SCSI host but also creates the scsi_eh_<n> kernel thread and the scsi_tmf_<n> workqueue. Stop these threads if login fails by callingscsi_host_put().Reported-by Konstantin Krotov <[email protected]>Fixes fb49c8bbaae7 ("Remove an extraneous scsi_host_put() from an error path")Signed-off-by Bart Van Assche <[email protected]>Cc Sagi Grimberg <sagig-VPRAkNaXOzVWk0Htik3J/[email protected]>Cc Sebastian Parschauer <[email protected]>Cc <[email protected]> #v3.19
Thanks, added to the srp branch.
Signature · 2 lines
Doug Ledford <[email protected]> GPG KeyID: 0E572FDD