]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
scsi: qla2xxx: Reduce false trigger to login
authorQuinn Tran <qutran@marvell.com>
Thu, 10 Mar 2022 09:26:00 +0000 (01:26 -0800)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 27 Apr 2022 09:58:42 +0000 (11:58 +0200)
BugLink: https://bugs.launchpad.net/bugs/1969110
commit d2646eed7b19a206912f49101178cbbaa507256c upstream.

While a session is in the middle of a relogin, a late RSCN can be delivered
from switch. RSCN trigger fabric scan where the scan logic can trigger
another session login while a login is in progress.  Reduce the extra
trigger to prevent multiple logins to the same session.

Link: https://lore.kernel.org/r/20220310092604.22950-10-njavali@marvell.com
Fixes: bee8b84686c4 ("scsi: qla2xxx: Reduce redundant ADISC command for RSCNs")
Cc: stable@vger.kernel.org
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit f63fde0d16a400ccc08312cae90bb3a5f54744a2)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/scsi/qla2xxx/qla_init.c

index b0a0be94ca30fda138f8aacd1e12764ccc31a488..af8df5a800c61c51c41ec3f92e5666cc01fced03 100644 (file)
@@ -1645,7 +1645,8 @@ int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport)
            fcport->login_gen, fcport->loop_id, fcport->scan_state,
            fcport->fc4_type);
 
-       if (fcport->scan_state != QLA_FCPORT_FOUND)
+       if (fcport->scan_state != QLA_FCPORT_FOUND ||
+           fcport->disc_state == DSC_DELETE_PEND)
                return 0;
 
        if ((fcport->loop_id != FC_NO_LOOP_ID) &&
@@ -1666,7 +1667,7 @@ int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport)
        if (vha->host->active_mode == MODE_TARGET && !N2N_TOPO(vha->hw))
                return 0;
 
-       if (fcport->flags & FCF_ASYNC_SENT) {
+       if (fcport->flags & (FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE)) {
                set_bit(RELOGIN_NEEDED, &vha->dpc_flags);
                return 0;
        }