On Tue, 2020-05-19 at 02:22 +0300, Roman Bolshakov wrote:
On Mon, May 18, 2020 at 09:31:42PM +0300, Roman Bolshakov wrote:
P.S. A little bit cleaner alternative would be to avoid session deletion only if scan needed is set (that allows session deletion of initiator ports after fabric discovery if N_Port ID change happened). Please let me know if I should submit v2 like this:
diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index 42c3ad27f1cb..b9955af5cffe 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c @@ -3495,8 +3495,10 @@ void qla24xx_async_gnnft_done(scsi_qla_host_t *vha, srb_t *sp) if ((fcport->flags & FCF_FABRIC_DEVICE) == 0) { qla2x00_clear_loop_id(fcport); fcport->flags |= FCF_FABRIC_DEVICE;
} else if (fcport->d_id.b24 != rp->id.b24 ||
fcport->scan_needed) {
} else if (fcport->d_id.b24 != rp->id.b24 ||
(fcport->scan_needed &&
fcport->port_type != FCT_INITIATOR
&&
fcport->port_type !=
FCT_NVME_INITIATOR)) { qlt_schedule_sess_for_deletion(fcport); } fcport->d_id.b24 = rp->id.b24;
Yes, this looks like an improvement to me. To express it in my own words (as the logic is subtle): wrt the original code, this only changes the behavior if the NPort ID is unchanged but "scan_needed" is set - in this case the session used to be deleted, but with this patch it isn't any more.
Thanks, Martin