Thread (1 message) 1 message, 1 author, 2012-08-09
DORMANTno replies

[PATCH 10/20] ib_srp: Keep processing commands during scsi_remove_host()

From: Bart Van Assche <hidden>
Date: 2012-08-09 15:52:38
Subsystem: infiniband subsystem, scsi rdma protocol (srp) initiator, the rest · Maintainers: Jason Gunthorpe, Leon Romanovsky, Bart Van Assche, Linus Torvalds

Some SCSI upper layer drivers, e.g. sd, issue SCSI commands from
inside scsi_remove_host() (see also the sd_shutdown() call in
sd_remove()). Make sure that these commands have a chance to reach
the SCSI device.

Signed-off-by: Bart Van Assche <redacted>
Cc: David Dillow <redacted>
Cc: Roland Dreier <redacted>
---
 drivers/infiniband/ulp/srp/ib_srp.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index a7f42f3..0e7825a 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -1336,9 +1336,7 @@ static int srp_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmnd)
 	unsigned long flags;
 	int len;
 
-	if (target->state == SRP_TARGET_REMOVED ||
-	    !target->connected ||
-	    target->qp_in_error) {
+	if (!target->connected || target->qp_in_error) {
 		scmnd->result = DID_BAD_TARGET << 16;
 		scmnd->scsi_done(scmnd);
 		return 0;
@@ -1688,9 +1686,7 @@ static int srp_send_tsk_mgmt(struct srp_target_port *target,
 	struct srp_iu *iu;
 	struct srp_tsk_mgmt *tsk_mgmt;
 
-	if (target->state == SRP_TARGET_REMOVED ||
-	    !target->connected ||
-	    target->qp_in_error)
+	if (!target->connected || target->qp_in_error)
 		return -1;
 
 	init_completion(&target->tsk_mgmt_done);
-- 
1.7.7

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help