Sophie

Sophie

distrib > CentOS > 5 > x86_64 > by-pkgid > ea32411352494358b8d75a78402a4713 > files > 4601

kernel-2.6.18-238.19.1.el5.centos.plus.src.rpm

From: Chad Dupuis <cdupuis@redhat.com>
Date: Fri, 3 Sep 2010 21:40:29 -0400
Subject: [scsi] qla2xxx: cover UNDERRUN case where SCSI status set
Message-id: <20100903214029.2767.97076.sendpatchset@localhost.localdomain>
Patchwork-id: 28148
O-Subject: [RHEL 5.6 PATCH 6/9] qla2xxx: Cover UNDERRUN case where SCSI status
	is set.
Bugzilla: 619814
RH-Acked-by: Rob Evers <revers@redhat.com>

Bugzilla
--------

Bug 619814 (https://bugzilla.redhat.com/show_bug.cgi?id=619814)

Upstream Status
---------------

Will be submitted upstream with our next patch submission.

Description
-----------

>From 1d51df3fa8242432ed85876cf40e4f378222b7f1 Mon Sep 17 00:00:00 2001
From: Lalit Chandivade <lalit.chandivade@qlogic.com>
Date: Wed, 21 Jul 2010 12:36:14 +0530
Subject: [PATCH] qla2xxx: Cover UNDERRUN case where SCSI status is set.

Currently, if target sets the SCSI Status (with Check condition)
and there is no FCP residual bit set then driver  does not check
for dropped frame.  This could lead to data corruption.

diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index beedcfc..d61c089 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -1211,7 +1211,7 @@ qla2x00_status_entry(scsi_qla_host_t *ha, void *pkt)
 				cp->result = DID_ERROR << 16;
 				break;
 			}
-		} else if (!lscsi_status) {
+		} else {
 			/*
 			 * If RISC reports underrun and target does not report
 			 * it then we must have a lost frame, so tell upper
@@ -1223,13 +1223,14 @@ qla2x00_status_entry(scsi_qla_host_t *ha, void *pkt)
 			    ha->host_no, cp->device->id, cp->device->lun,
 			    resid, scsi_bufflen(cp)));
 
-			cp->result = DID_ERROR << 16;
-			break;
+			cp->result = DID_ERROR << 16 | lscsi_status;
+			goto check_scsi_status;
 		}
 
 		cp->result = DID_OK << 16 | lscsi_status;
 		logit = 0;
 
+check_scsi_status:
 		/*
 		 * Check to see if SCSI Status is non zero. If so report SCSI
 		 * Status.