When the port is already started we don't need to login; that
will only confuse the state machine.

Signed-off-by: Hannes Reinecke <h...@suse.com>
---
 drivers/scsi/libfc/fc_rport.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index afc1f9b..8dd656e 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -418,6 +418,12 @@ static int fc_rport_login(struct fc_rport_priv *rdata)
 {
        mutex_lock(&rdata->rp_mutex);
 
+       if (rdata->flags & FC_RP_STARTED) {
+               FC_RPORT_DBG(rdata, "port already started\n");
+               mutex_unlock(&rdata->rp_mutex);
+               return 0;
+       }
+
        rdata->flags |= FC_RP_STARTED;
        switch (rdata->rp_state) {
        case RPORT_ST_READY:
-- 
1.8.5.6

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to