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 <[email protected]>
Cc: David Dillow <[email protected]>
Cc: Roland Dreier <[email protected]>
---
 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to