When running in point-to-multipoint mode PLOGI is done after
FLOGI completed. So when the PLOGI fails we should be sending
a LOGO to the remote port.

Signed-off-by: Hannes Reinecke <[email protected]>
---
 drivers/scsi/libfc/fc_rport.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index 0ea0d4f..bfad971 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -593,15 +593,23 @@ static void fc_rport_timeout(struct work_struct *work)
  */
 static void fc_rport_error(struct fc_rport_priv *rdata, int err)
 {
+       struct fc_lport *lport = rdata->local_port;
+
        FC_RPORT_DBG(rdata, "Error %d in state %s, retries %d\n",
                     -err, fc_rport_state(rdata), rdata->retries);
 
        switch (rdata->rp_state) {
        case RPORT_ST_FLOGI:
-       case RPORT_ST_PLOGI:
                rdata->flags &= ~FC_RP_STARTED;
                fc_rport_enter_delete(rdata, RPORT_EV_FAILED);
                break;
+       case RPORT_ST_PLOGI:
+               if (lport->point_to_multipoint) {
+                       rdata->flags &= ~FC_RP_STARTED;
+                       fc_rport_enter_delete(rdata, RPORT_EV_FAILED);
+               } else
+                       fc_rport_enter_logo(rdata);
+               break;
        case RPORT_ST_RTV:
                fc_rport_enter_ready(rdata);
                break;
-- 
1.8.5.6

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

Reply via email to