scsi: qla2xxx: Spinlock recursion in qla_target
The patch reverts changes done in qlt_schedule_sess_for_deletion() to
avoid spinlock recursion sess->vha->work_lock should be used instead
of ha->tgt.sess_lock, that can be locked in callers: qlt_reset() or
qlt_handle_login()
[mkp: roll in build warning reported by sfr]
Fixes: 1c6cacf4ea
("scsi: qla2xxx: Fixup locking for session deletion")
Cc: <stable@vger.kernel.org> #v4.17
Signed-off-by: Mikhail Malygin <m.malygin@yadro.com>
Reported-by: Mikhail Malygin <m.malygin@yadro.com>
Tested-by: Mikhail Malygin <m.malygin@yadro.com>
Acked-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
f2233a33dc
commit
49d7bd3681
|
@ -1224,7 +1224,6 @@ static void qla24xx_chk_fcp_state(struct fc_port *sess)
|
|||
void qlt_schedule_sess_for_deletion(struct fc_port *sess)
|
||||
{
|
||||
struct qla_tgt *tgt = sess->tgt;
|
||||
struct qla_hw_data *ha = sess->vha->hw;
|
||||
unsigned long flags;
|
||||
|
||||
if (sess->disc_state == DSC_DELETE_PEND)
|
||||
|
@ -1241,16 +1240,16 @@ void qlt_schedule_sess_for_deletion(struct fc_port *sess)
|
|||
return;
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&ha->tgt.sess_lock, flags);
|
||||
if (sess->deleted == QLA_SESS_DELETED)
|
||||
sess->logout_on_delete = 0;
|
||||
|
||||
spin_lock_irqsave(&sess->vha->work_lock, flags);
|
||||
if (sess->deleted == QLA_SESS_DELETION_IN_PROGRESS) {
|
||||
spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
|
||||
spin_unlock_irqrestore(&sess->vha->work_lock, flags);
|
||||
return;
|
||||
}
|
||||
sess->deleted = QLA_SESS_DELETION_IN_PROGRESS;
|
||||
spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
|
||||
spin_unlock_irqrestore(&sess->vha->work_lock, flags);
|
||||
|
||||
sess->disc_state = DSC_DELETE_PEND;
|
||||
|
||||
|
|
Loading…
Reference in New Issue