Browse Source

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>
Roland Dreier 19 years ago
parent
commit
1285b3a0b0
1 changed files with 6 additions and 0 deletions
  1. 6 0
      drivers/infiniband/ulp/srp/ib_srp.c

+ 6 - 0
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;