[SCSI] libfc: call fc_remote_port_chkready under the host lock.
authorMike Christie <michaelc@cs.wisc.edu>
Mon, 2 Aug 2010 21:02:24 +0000 (16:02 -0500)
committerJames Bottomley <James.Bottomley@suse.de>
Fri, 6 Aug 2010 16:00:26 +0000 (11:00 -0500)
The rport port state and flags are set under the host lock,
so this patch calls fc_remote_port_chkready with the host lock
held like is also done in the other fc drivers.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/libfc/fc_fcp.c

index eac4d09314eb95828ae8f308ec4cc5d77372c629..c797f6b48f05bccff273e06964c0dc06508de174 100644 (file)
@@ -1765,14 +1765,14 @@ int fc_queuecommand(struct scsi_cmnd *sc_cmd, void (*done)(struct scsi_cmnd *))
        struct fcoe_dev_stats *stats;
 
        lport = shost_priv(sc_cmd->device->host);
-       spin_unlock_irq(lport->host->host_lock);
 
        rval = fc_remote_port_chkready(rport);
        if (rval) {
                sc_cmd->result = rval;
                done(sc_cmd);
-               goto out;
+               return 0;
        }
+       spin_unlock_irq(lport->host->host_lock);
 
        if (!*(struct fc_remote_port **)rport->dd_data) {
                /*