summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp
diff options
context:
space:
mode:
authorRoland Dreier <rolandd@cisco.com>2006-03-03 15:47:25 -0800
committerRoland Dreier <rolandd@cisco.com>2006-03-03 17:50:16 -0800
commit1285b3a0b0aa2391ac6f6939e6737203c8220f68 (patch)
treeb0041f55811fcda35614e6c04cb67e251d05a51f /drivers/infiniband/ulp
parentc499ec24c31edf270e777a868ffd0daddcfe7ebd (diff)
downloadop-kernel-dev-1285b3a0b0aa2391ac6f6939e6737203c8220f68.zip
op-kernel-dev-1285b3a0b0aa2391ac6f6939e6737203c8220f68.tar.gz
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. Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/ulp')
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 2d2d4ac..960dae5 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -1155,6 +1155,12 @@ static int srp_send_tsk_mgmt(struct scsi_cmnd *scmnd, u8 func)
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;
OpenPOWER on IntegriCloud