aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libfc/fc_rport.c
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2016-09-30 11:01:18 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2016-11-08 17:29:47 -0500
commit06ee2571a438653bd14c33c70379a5f008a91901 (patch)
tree8b3dde0e59f316662d1c976008f22251132b19bc /drivers/scsi/libfc/fc_rport.c
parentscsi: libfc: Do not drop down to FLOGI for fc_rport_login() (diff)
downloadlinux-dev-06ee2571a438653bd14c33c70379a5f008a91901.tar.xz
linux-dev-06ee2571a438653bd14c33c70379a5f008a91901.zip
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>
Diffstat (limited to 'drivers/scsi/libfc/fc_rport.c')
-rw-r--r--drivers/scsi/libfc/fc_rport.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index 4e4087a00836..72a7183fdd06 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: