stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org,
	Bart Van Assche <bart.vanassche@sandisk.com>,
	James Bottomley <JBottomley@Odin.com>,
	Sagi Grimberg <sagig@mellanox.com>,
	Sebastian Parschauer <sebastian.riemer@profitbricks.com>,
	Doug Ledford <dledford@redhat.com>
Subject: [PATCH 4.1 51/65] scsi_transport_srp: Fix a race condition
Date: Sun, 19 Jul 2015 12:08:10 -0700	[thread overview]
Message-ID: <20150719190811.144305210@linuxfoundation.org> (raw)
In-Reply-To: <20150719190809.469715936@linuxfoundation.org>

4.1-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Bart Van Assche <bart.vanassche@sandisk.com>

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:
 [<ffffffff814c65a2>] dump_stack+0x4e/0x68
 [<ffffffff81051f71>] warn_slowpath_common+0x81/0xa0
 [<ffffffff8105204a>] warn_slowpath_null+0x1a/0x20
 [<ffffffffa075f51f>] srp_terminate_io+0xef/0x100 [ib_srp]
 [<ffffffffa07495da>] __rport_fail_io_fast+0xba/0xc0 [scsi_transport_srp]
 [<ffffffffa0749a90>] rport_fast_io_fail_timedout+0xe0/0xf0 [scsi_transport_srp]
 [<ffffffff8106e09b>] process_one_work+0x1db/0x780
 [<ffffffff8106e75b>] worker_thread+0x11b/0x450
 [<ffffffff81073c64>] kthread+0xe4/0x100
 [<ffffffff814cf26c>] 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 <bart.vanassche@sandisk.com>
Cc: James Bottomley <JBottomley@Odin.com>
Cc: Sagi Grimberg <sagig@mellanox.com>
Cc: Sebastian Parschauer <sebastian.riemer@profitbricks.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 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);
+	}
 }
 
 /**



  parent reply	other threads:[~2015-07-19 19:08 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-19 19:07 [PATCH 4.1 00/65] 4.1.3-stable review Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 01/65] fs: Add helper functions for permanently empty directories Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 02/65] sysctl: Allow creating permanently empty directories that serve as mountpoints Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 03/65] proc: Allow creating permanently empty directories that serve as mount points Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 04/65] kernfs: Add support for always empty directories Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 05/65] sysfs: Add support for permanently empty directories to serve as mount points Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 06/65] sysfs: Create mountpoints with sysfs_create_mount_point Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 07/65] mnt: Update fs_fully_visible to test for permanently empty directories Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 08/65] mnt: Refactor the logic for mounting sysfs and proc in a user namespace Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 09/65] mnt: Modify fs_fully_visible to deal with locked ro nodev and atime Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 10/65] gpio: crystalcove: set IRQCHIP_SKIP_SET_WAKE for the irqchip Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 11/65] gpio: rcar: Check for irq_set_irq_wake() failures Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 12/65] rcu: Correctly handle non-empty Tiny RCU callback list with none ready Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 13/65] ipr: Increase default adapter init stage change timeout Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 14/65] Disable write buffering on Toshiba ToPIC95 Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 15/65] ALSA: pcm: Fix pcm_class sysfs output Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 16/65] ALSA: hda - Fix Dock Headphone on Thinkpad X250 seen as a Line Out Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 17/65] ALSA: hda - set proper caps for newer AMD hda audio in KB/KV Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 18/65] ALSA: hda - Disable widget power-save for VIA codecs Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 19/65] ALSA: hda - restore the MIC FIXUP for some Dell machines Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 20/65] ALSA: hda - Add headset support to Acer Aspire V5 Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 21/65] ALSA: hda - Fix the dock headphone output on Fujitsu Lifebook E780 Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 22/65] ALSA: hda - Add a fixup for Dell E7450 Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 23/65] ACPI / init: Switch over platform to the ACPI mode later Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 24/65] ACPI / PM: Add missing pm_generic_complete() invocation Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 25/65] ACPI / PNP: Avoid conflicting resource reservations Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 26/65] iio: accel: kxcjk-1013: add the "KXCJ9000" ACPI id Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 27/65] tools selftests: Fix clean target with make 3.81 Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 28/65] ARC: add smp barriers around atomics per Documentation/atomic_ops.txt Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 29/65] ARC: add compiler barrier to LLSC based cmpxchg Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 30/65] arc: fix use of uninitialized arc_pmu Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 31/65] power_supply: Fix NULL pointer dereference during bq27x00_battery probe Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 32/65] power_supply: Fix possible NULL pointer dereference on early uevent Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 33/65] mei: me: wait for power gating exit confirmation Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 34/65] mei: txe: reduce suspend/resume time Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 35/65] arm64: Do not attempt to use init_mm in reset_context() Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 36/65] arm64: entry: fix context tracking for el0_sp_pc Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 37/65] arm64: mm: Fix freeing of the wrong memmap entries with !SPARSEMEM_VMEMMAP Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 38/65] arm64: vdso: work-around broken ELF toolchains in Makefile Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 39/65] mm: kmemleak: allow safe memory scanning during kmemleak disabling Greg Kroah-Hartman
2015-07-19 19:07 ` [PATCH 4.1 40/65] mm: kmemleak_alloc_percpu() should follow the gfp from per_alloc() Greg Kroah-Hartman
2015-07-19 19:08 ` [PATCH 4.1 41/65] mm, thp: respect MPOL_PREFERRED policy with non-local node Greg Kroah-Hartman
2015-07-19 19:08 ` [PATCH 4.1 42/65] regmap: Fix regmap_bulk_read in BE mode Greg Kroah-Hartman
2015-07-19 19:08 ` [PATCH 4.1 43/65] regmap: Fix possible shift overflow in regmap_field_init() Greg Kroah-Hartman
2015-07-19 19:08 ` [PATCH 4.1 44/65] regulator: max77686: fix gpio_enabled shift wrapping bug Greg Kroah-Hartman
2015-07-19 19:08 ` [PATCH 4.1 45/65] regulator: core: fix constraints output buffer Greg Kroah-Hartman
2015-07-19 19:08 ` [PATCH 4.1 46/65] livepatch: add module locking around kallsyms calls Greg Kroah-Hartman
2015-07-19 19:08 ` [PATCH 4.1 48/65] spi: orion: Fix maximum baud rates for Armada 370/XP Greg Kroah-Hartman
2015-07-19 19:08 ` [PATCH 4.1 49/65] spi: pl022: Specify num-cs property as required in devicetree binding Greg Kroah-Hartman
2015-07-19 19:08 ` [PATCH 4.1 50/65] scsi_transport_srp: Introduce srp_wait_for_queuecommand() Greg Kroah-Hartman
2015-07-19 19:08 ` Greg Kroah-Hartman [this message]
2015-07-19 19:08 ` [PATCH 4.1 52/65] IB/srp: Remove an extraneous scsi_host_put() from an error path Greg Kroah-Hartman
2015-07-19 19:08 ` [PATCH 4.1 53/65] IB/srp: Fix a connection setup race Greg Kroah-Hartman
2015-07-19 19:08 ` [PATCH 4.1 54/65] IB/srp: Fix connection state tracking Greg Kroah-Hartman
2015-07-19 19:08 ` [PATCH 4.1 55/65] IB/srp: Fix reconnection failure handling Greg Kroah-Hartman
2015-07-19 19:08 ` [PATCH 4.1 56/65] genirq: devres: Fix testing return value of request_any_context_irq() Greg Kroah-Hartman
2015-07-19 19:08 ` [PATCH 4.1 57/65] video: mxsfb: Make sure axi clock is enabled when accessing registers Greg Kroah-Hartman
2015-07-19 19:08 ` [PATCH 4.1 58/65] leds / PM: fix hibernation on arm when gpio-led used with CPU led trigger Greg Kroah-Hartman
2015-07-19 19:08 ` [PATCH 4.1 59/65] mtd: fix: avoid race condition when accessing mtd->usecount Greg Kroah-Hartman
2015-07-19 19:08 ` [PATCH 4.1 61/65] PCI: Propagate the "ignore hotplug" setting to parent Greg Kroah-Hartman
2015-07-19 19:08 ` [PATCH 4.1 62/65] PCI: Add pci_bus_addr_t Greg Kroah-Hartman
2015-07-19 19:08 ` [PATCH 4.1 63/65] PCI: pciehp: Wait for hotplug command completion where necessary Greg Kroah-Hartman
2015-07-19 19:08 ` [PATCH 4.1 64/65] of/pci: Fix pci_address_to_pio() conversion of CPU address to I/O port Greg Kroah-Hartman
2015-07-19 19:08 ` [PATCH 4.1 65/65] Input: pixcir_i2c_ts - fix receive error Greg Kroah-Hartman
2015-07-20  3:19 ` [PATCH 4.1 00/65] 4.1.3-stable review Guenter Roeck
2015-07-20 19:26   ` Greg Kroah-Hartman
2015-07-20  6:33 ` Sudip Mukherjee
2015-07-20 19:27   ` Greg Kroah-Hartman
2015-07-20 17:17 ` Shuah Khan
2015-07-20 19:27   ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150719190811.144305210@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=JBottomley@Odin.com \
    --cc=bart.vanassche@sandisk.com \
    --cc=dledford@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sagig@mellanox.com \
    --cc=sebastian.riemer@profitbricks.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).