From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:43473 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753751AbbGQCm3 (ORCPT ); Thu, 16 Jul 2015 22:42:29 -0400 Subject: Patch "scsi_transport_srp: Fix a race condition" has been added to the 4.1-stable tree To: bart.vanassche@sandisk.com, JBottomley@Odin.com, dledford@redhat.com, gregkh@linuxfoundation.org, sagig@mellanox.com, sebastian.riemer@profitbricks.com Cc: , From: Date: Thu, 16 Jul 2015 19:42:28 -0700 Message-ID: <143710094820950@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 scsi_transport_srp: Fix a race condition 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: scsi_transport_srp-fix-a-race-condition.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 535fb906225fb7436cb658144d0c0cea14a26f3e Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 18 May 2015 13:22:44 +0200 Subject: scsi_transport_srp: Fix a race condition From: Bart Van Assche commit 535fb906225fb7436cb658144d0c0cea14a26f3e upstream. Avoid that srp_terminate_io() can get invoked while srp_queuecommand() is in progress. This patch avoids that an I/O timeout can trigger the following kernel warning: WARNING: at drivers/infiniband/ulp/srp/ib_srp.c:1447 srp_terminate_io+0xef/0x100 [ib_srp]() Call Trace: [] dump_stack+0x4e/0x68 [] warn_slowpath_common+0x81/0xa0 [] warn_slowpath_null+0x1a/0x20 [] srp_terminate_io+0xef/0x100 [ib_srp] [] __rport_fail_io_fast+0xba/0xc0 [scsi_transport_srp] [] rport_fast_io_fail_timedout+0xe0/0xf0 [scsi_transport_srp] [] process_one_work+0x1db/0x780 [] worker_thread+0x11b/0x450 [] kthread+0xe4/0x100 [] ret_from_fork+0x7c/0xb0 See also patch "scsi_transport_srp: Add transport layer error handling" (commit ID 29c17324803c). Signed-off-by: Bart Van Assche Cc: James Bottomley Cc: Sagi Grimberg Cc: Sebastian Parschauer Signed-off-by: Doug Ledford Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/scsi_transport_srp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/scsi/scsi_transport_srp.c +++ b/drivers/scsi/scsi_transport_srp.c @@ -439,8 +439,10 @@ static void __rport_fail_io_fast(struct /* Involve the LLD if possible to terminate all I/O on the rport. */ i = to_srp_internal(shost->transportt); - if (i->f->terminate_rport_io) + if (i->f->terminate_rport_io) { + srp_wait_for_queuecommand(shost); i->f->terminate_rport_io(rport); + } } /** Patches currently in stable-queue which might be from bart.vanassche@sandisk.com are queue-4.1/ib-srp-fix-a-connection-setup-race.patch queue-4.1/scsi_transport_srp-introduce-srp_wait_for_queuecommand.patch queue-4.1/ib-srp-fix-connection-state-tracking.patch queue-4.1/ib-srp-fix-reconnection-failure-handling.patch queue-4.1/scsi_transport_srp-fix-a-race-condition.patch queue-4.1/ib-srp-remove-an-extraneous-scsi_host_put-from-an-error-path.patch