]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
IB/srp fix for commands received after target removed from Roland.
authorChris Wright <chrisw@sous-sol.org>
Tue, 7 Mar 2006 05:26:56 +0000 (21:26 -0800)
committerChris Wright <chrisw@sous-sol.org>
Tue, 7 Mar 2006 05:26:56 +0000 (21:26 -0800)
queue/ib-srp-don-t-send-task-management-commands-after-target-removal.patch [new file with mode: 0644]
queue/series [new file with mode: 0644]

diff --git a/queue/ib-srp-don-t-send-task-management-commands-after-target-removal.patch b/queue/ib-srp-don-t-send-task-management-commands-after-target-removal.patch
new file mode 100644 (file)
index 0000000..1b4833d
--- /dev/null
@@ -0,0 +1,35 @@
+From stable-bounces@linux.kernel.org  Mon Mar  6 20:28:25 2006
+Date: Mon, 06 Mar 2006 20:23:33 -0800
+From: Roland Dreier <rdreier@cisco.com>
+To: stable@kernel.org
+Cc: 
+Subject: [PATCH] IB/srp: Don't send task management commands after target removal
+
+Just fail abort and reset requests that come in after we've already
+decided to remove a target.  This fixes a nasty crash if a storage
+target goes away.
+
+Signed-off-by: Roland Dreier <rolandd@cisco.com>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+
+This is upstream in Linus's tree as 1285b3a0b0aa2391ac6f6939e6737203c8220f68
+
+ drivers/infiniband/ulp/srp/ib_srp.c |    6 ++++++
+ 1 files changed, 6 insertions(+)
+
+--- linux-2.6.15.6.orig/drivers/infiniband/ulp/srp/ib_srp.c
++++ linux-2.6.15.6/drivers/infiniband/ulp/srp/ib_srp.c
+@@ -1154,6 +1154,12 @@ static int srp_send_tsk_mgmt(struct scsi
+       spin_lock_irq(target->scsi_host->host_lock);
++      if (target->state == SRP_TARGET_DEAD ||
++          target->state == SRP_TARGET_REMOVED) {
++              scmnd->result = DID_BAD_TARGET << 16;
++              goto out;
++      }
++
+       if (scmnd->host_scribble == (void *) -1L)
+               goto out;
diff --git a/queue/series b/queue/series
new file mode 100644 (file)
index 0000000..2a0d4af
--- /dev/null
@@ -0,0 +1 @@
+ib-srp-don-t-send-task-management-commands-after-target-removal.patch