Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Bond <dbond@suse.com>2018-07-04 12:48:59 -0400
committerDavid Bond <dbond@suse.com>2018-07-04 12:48:59 -0400
commit961f89f4a5a227660951d62baa6304c2da10dc70 (patch)
tree5bc556172dc49fe7aeca9d254a64134dd55942c6
parent7573f5a733931ea6b5c7d3196a9fca3117ca0e13 (diff)
scsi: qla2xxx: Spinlock recursion in qla_target (bsc#1097501)
-rw-r--r--patches.drivers/scsi-qla2xxx-Spinlock-recursion-in-qla_target.patch63
-rw-r--r--series.conf3
2 files changed, 66 insertions, 0 deletions
diff --git a/patches.drivers/scsi-qla2xxx-Spinlock-recursion-in-qla_target.patch b/patches.drivers/scsi-qla2xxx-Spinlock-recursion-in-qla_target.patch
new file mode 100644
index 0000000000..6dca0408f1
--- /dev/null
+++ b/patches.drivers/scsi-qla2xxx-Spinlock-recursion-in-qla_target.patch
@@ -0,0 +1,63 @@
+From 49d7bd36813ea8e6b4c97b640d24e7fbd44c84f0 Mon Sep 17 00:00:00 2001
+From: Mikhail Malygin <m.malygin@yadro.com>
+Date: Wed, 13 Jun 2018 13:05:57 +0000
+Subject: [PATCH] scsi: qla2xxx: Spinlock recursion in qla_target
+Acked-by: David Bond <dbond@suse.com>
+References: bsc#1097501
+Patch-mainline: Queued in subsystem maintainer repository
+Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git
+Git-commit: 49d7bd36813ea8e6b4c97b640d24e7fbd44c84f0
+
+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: 1c6cacf4ea6c04 ("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>
+---
+ drivers/scsi/qla2xxx/qla_target.c | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
+index 0fea2e2326be..1027b0cb7fa3 100644
+--- a/drivers/scsi/qla2xxx/qla_target.c
++++ b/drivers/scsi/qla2xxx/qla_target.c
+@@ -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;
+
+--
+2.13.7
+
diff --git a/series.conf b/series.conf
index 8ca382cb8e..b7141721ed 100644
--- a/series.conf
+++ b/series.conf
@@ -23698,6 +23698,9 @@
patches.suse/nospec-fix-forced-cpucaps-ordering.patch
patches.suse/0001-KVM-x86-Sync-back-MSR_IA32_SPEC_CTRL-to-VCPU-data-st.patch
+ # bsc#1097501
+ patches.drivers/scsi-qla2xxx-Spinlock-recursion-in-qla_target.patch
+
########################################################
# You'd better have a good reason for adding a patch
# below here.