Commit 06ee2571 authored by Hannes Reinecke's avatar Hannes Reinecke Committed by Martin K. Petersen

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: default avatarHannes Reinecke <hare@suse.com>
Acked-by: default avatarJohannes Thumshirn <jth@kernel.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent e5a20009
...@@ -418,6 +418,12 @@ static int fc_rport_login(struct fc_rport_priv *rdata) ...@@ -418,6 +418,12 @@ static int fc_rport_login(struct fc_rport_priv *rdata)
{ {
mutex_lock(&rdata->rp_mutex); 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; rdata->flags |= FC_RP_STARTED;
switch (rdata->rp_state) { switch (rdata->rp_state) {
case RPORT_ST_READY: case RPORT_ST_READY:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment