Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1608766

[PATCH 4.10 03/27] qla2xxx: Fix request queue corruption.

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject [PATCH 4.10 03/27] qla2xxx: Fix request queue corruption.
Date 2017-03-24 19:10 +0100
Message-ID <toBOX-5jj-61@gated-at.bofh.it> (permalink)
References <toBFf-50v-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


4.10-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Quinn Tran <quinn.tran@cavium.com>

commit 8b666809e10cda9814af3e8be339d35b83909056 upstream.

When FW notify driver or driver detects low FW resource,
driver tries to send out Busy SCSI Status to tell Initiator
side to back off. During the send process, the lock was not held.

Signed-off-by: Quinn Tran <quinn.tran@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/scsi/qla2xxx/qla_target.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

--- a/drivers/scsi/qla2xxx/qla_target.c
+++ b/drivers/scsi/qla2xxx/qla_target.c
@@ -5372,16 +5372,22 @@ qlt_send_busy(struct scsi_qla_host *vha,
 
 static int
 qlt_chk_qfull_thresh_hold(struct scsi_qla_host *vha,
-	struct atio_from_isp *atio)
+	struct atio_from_isp *atio, bool ha_locked)
 {
 	struct qla_hw_data *ha = vha->hw;
 	uint16_t status;
+	unsigned long flags;
 
 	if (ha->tgt.num_pend_cmds < Q_FULL_THRESH_HOLD(ha))
 		return 0;
 
+	if (!ha_locked)
+		spin_lock_irqsave(&ha->hardware_lock, flags);
 	status = temp_sam_status;
 	qlt_send_busy(vha, atio, status);
+	if (!ha_locked)
+		spin_unlock_irqrestore(&ha->hardware_lock, flags);
+
 	return 1;
 }
 
@@ -5426,7 +5432,7 @@ static void qlt_24xx_atio_pkt(struct scs
 
 
 		if (likely(atio->u.isp24.fcp_cmnd.task_mgmt_flags == 0)) {
-			rc = qlt_chk_qfull_thresh_hold(vha, atio);
+			rc = qlt_chk_qfull_thresh_hold(vha, atio, ha_locked);
 			if (rc != 0) {
 				tgt->atio_irq_cmd_count--;
 				return;
@@ -5549,7 +5555,7 @@ static void qlt_response_pkt(struct scsi
 			break;
 		}
 
-		rc = qlt_chk_qfull_thresh_hold(vha, atio);
+		rc = qlt_chk_qfull_thresh_hold(vha, atio, true);
 		if (rc != 0) {
 			tgt->irq_cmd_count--;
 			return;

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 4.10 00/27] 4.10.6-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-24 19:00 +0100
  [PATCH 4.10 10/27] xprtrdma: Squelch kbuild sparse complaint Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-24 19:00 +0100
  [PATCH 4.10 14/27] hwrng: omap - write registers after enabling the clock Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-24 19:10 +0100
  [PATCH 4.10 12/27] cpufreq: Fix and clean up show_cpuinfo_cur_freq() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-24 19:10 +0100
  [PATCH 4.10 11/27] NFS prevent double free in async nfs4_exchange_id Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-24 19:10 +0100
  [PATCH 4.10 15/27] hwrng: omap - use devm_clk_get() instead of of_clk_get() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-24 19:10 +0100
  [PATCH 4.10 06/27] parisc: Fix system shutdown halt Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-24 19:10 +0100
  [PATCH 4.10 23/27] isdn/gigaset: fix NULL-deref at probe Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-24 19:10 +0100
  [PATCH 4.10 03/27] qla2xxx: Fix request queue corruption. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-24 19:10 +0100
  [PATCH 4.10 25/27] percpu: acquire pcpu_lock when updating pcpu_nr_empty_pop_pages Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-24 19:10 +0100
  [PATCH 4.10 08/27] perf/core: Fix event inheritance on fork() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-24 19:10 +0100
  [PATCH 4.10 16/27] hwrng: omap - Do not access INTMASK_REG on EIP76 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-24 19:10 +0100
  [PATCH 4.10 17/27] md/raid1/10: fix potential deadlock Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-24 19:10 +0100
  [PATCH 4.10 13/27] powerpc/boot: Fix zImage TOC alignment Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-24 19:10 +0100
  [PATCH 4.10 04/27] parisc: Optimize flush_kernel_vmap_range and invalidate_kernel_vmap_range Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-24 19:10 +0100
  [PATCH 4.10 09/27] md/r5cache: fix set_syndrome_sources() for data in cache Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-24 19:10 +0100
  [PATCH 4.10 02/27] qla2xxx: Fix memory leak for abts processing Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-24 19:10 +0100
  [PATCH 4.10 01/27] give up on gcc ilog2() constant optimizations Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-24 19:10 +0100
  [PATCH 4.10 19/27] scsi: lpfc: Add shutdown method for kexec Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-24 19:10 +0100
  [PATCH 4.10 05/27] parisc: support R_PARISC_SECREL32 relocation in modules Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-24 19:20 +0100
  [PATCH 4.10 07/27] perf/core: Fix use-after-free in perf_release() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-24 19:20 +0100
  [PATCH 4.10 22/27] target: Fix VERIFY_16 handling in sbc_parse_cdb Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-24 19:30 +0100
  [PATCH 4.10 20/27] scsi: libiscsi: add lock around task lists to fix list corruption regression Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-24 19:30 +0100
  [PATCH 4.10 18/27] target/pscsi: Fix TYPE_TAPE + TYPE_MEDIMUM_CHANGER export Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-24 19:30 +0100
  [PATCH 4.10 21/27] scsi: mpt3sas: Avoid sleeping in interrupt context Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-24 19:30 +0100
  [PATCH 4.10 24/27] gfs2: Avoid alignment hole in struct lm_lockname Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-24 19:30 +0100
  [PATCH 4.10 26/27] cgroup/pids: remove spurious suspicious RCU usage warning Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-24 19:30 +0100
  Re: [PATCH 4.10 00/27] 4.10.6-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2017-03-25 01:10 +0100
    Re: [PATCH 4.10 00/27] 4.10.6-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-26 10:30 +0200
  Re: [PATCH 4.10 00/27] 4.10.6-stable review Guenter Roeck <linux@roeck-us.net> - 2017-03-25 05:20 +0100
    Re: [PATCH 4.10 00/27] 4.10.6-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-26 11:10 +0200

csiph-web