Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma
[sfrench/cifs-2.6.git] / drivers / infiniband / ulp / srp / ib_srp.c
index 0b09d0cd9b3c6450662537989df9d795ee4c1df0..c7bd96edce80ea3a65c1f79cbfcc2b226ccb96fd 100644 (file)
@@ -2340,7 +2340,6 @@ static void srp_handle_qp_err(struct ib_cq *cq, struct ib_wc *wc,
 static int srp_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmnd)
 {
        struct srp_target_port *target = host_to_target(shost);
-       struct srp_rport *rport = target->rport;
        struct srp_rdma_ch *ch;
        struct srp_request *req;
        struct srp_iu *iu;
@@ -2350,16 +2349,6 @@ static int srp_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmnd)
        u32 tag;
        u16 idx;
        int len, ret;
-       const bool in_scsi_eh = !in_interrupt() && current == shost->ehandler;
-
-       /*
-        * The SCSI EH thread is the only context from which srp_queuecommand()
-        * can get invoked for blocked devices (SDEV_BLOCK /
-        * SDEV_CREATED_BLOCK). Avoid racing with srp_reconnect_rport() by
-        * locking the rport mutex if invoked from inside the SCSI EH.
-        */
-       if (in_scsi_eh)
-               mutex_lock(&rport->mutex);
 
        scmnd->result = srp_chkready(target->rport);
        if (unlikely(scmnd->result))
@@ -2428,13 +2417,7 @@ static int srp_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmnd)
                goto err_unmap;
        }
 
-       ret = 0;
-
-unlock_rport:
-       if (in_scsi_eh)
-               mutex_unlock(&rport->mutex);
-
-       return ret;
+       return 0;
 
 err_unmap:
        srp_unmap_data(scmnd, ch, req);
@@ -2456,7 +2439,7 @@ err:
                ret = SCSI_MLQUEUE_HOST_BUSY;
        }
 
-       goto unlock_rport;
+       return ret;
 }
 
 /*