scsi: libfc: Do not login if the port is already started

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

Signed-off-by: Hannes Reinecke <hare@suse.com>
Acked-by: Johannes Thumshirn <jth@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Hannes Reinecke 2016-09-30 11:01:18 +02:00 committed by Martin K. Petersen
parent e5a20009da
commit 06ee2571a4
1 changed files with 6 additions and 0 deletions

View File

@ -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: