Skip to content

Commit c8a3479

Browse files
mwilckmartinkpetersen
authored andcommitted
scsi: qla2xxx: unregister ports after GPN_FT failure
When ports are lost due to unzoning them, and the initiator port is not part of any more zones, the GPN_FT command used for the fabric scan may fail. In this case, the current code simply gives up after a few retries. But if the zone is gone, all rports should actually be marked as lost. Fix this by jumping to the code that handles logout after GNN_FT after scan retries are exhausted. Fixes: f352eeb ("scsi: qla2xxx: Add ability to use GPNFT/GNNFT for RSCN handling") Link: https://lore.kernel.org/r/[email protected] Tested-by: Jason Orendorf <[email protected]> Signed-off-by: Martin Wilck <[email protected]> Acked-by: Himanshu Madhani <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent d341e9a commit c8a3479

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

drivers/scsi/qla2xxx/qla_gs.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3587,12 +3587,23 @@ void qla24xx_async_gnnft_done(scsi_qla_host_t *vha, srb_t *sp)
35873587
if (vha->scan.scan_retry < MAX_SCAN_RETRIES) {
35883588
set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags);
35893589
set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags);
3590+
goto out;
35903591
} else {
3591-
ql_dbg(ql_dbg_disc + ql_dbg_verbose, vha, 0xffff,
3592+
ql_dbg(ql_dbg_disc, vha, 0xffff,
35923593
"%s: Fabric scan failed for %d retries.\n",
35933594
__func__, vha->scan.scan_retry);
3595+
/*
3596+
* Unable to scan any rports. logout loop below
3597+
* will unregister all sessions.
3598+
*/
3599+
list_for_each_entry(fcport, &vha->vp_fcports, list) {
3600+
if ((fcport->flags & FCF_FABRIC_DEVICE) != 0) {
3601+
fcport->scan_state = QLA_FCPORT_SCAN;
3602+
fcport->logout_on_delete = 0;
3603+
}
3604+
}
3605+
goto login_logout;
35943606
}
3595-
goto out;
35963607
}
35973608
vha->scan.scan_retry = 0;
35983609

@@ -3670,6 +3681,7 @@ void qla24xx_async_gnnft_done(scsi_qla_host_t *vha, srb_t *sp)
36703681
dup_cnt);
36713682
}
36723683

3684+
login_logout:
36733685
/*
36743686
* Logout all previous fabric dev marked lost, except FCP2 devices.
36753687
*/

0 commit comments

Comments
 (0)