summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Vasquez <andrew.vasquez@qlogic.com>2005-12-06 10:58:06 -0800
committerJames Bottomley <jejb@mulgrave.(none)>2005-12-07 09:33:17 -0500
commit0da69df1e54146eece38e0a144051f6dd3526821 (patch)
tree80efaa4061980dea9638719923cd98ee7ab750b7
parent23443b1d6130eff8e1335e4f84eaf0577a331dcf (diff)
downloadlinux-0da69df1e54146eece38e0a144051f6dd3526821.tar.gz
linux-0da69df1e54146eece38e0a144051f6dd3526821.tar.bz2
linux-0da69df1e54146eece38e0a144051f6dd3526821.zip
[SCSI] qla2xxx: Correct short-WRITE status handling.
Properly check FC_RESID for any non-transfered bytes regardless of firmware completion status. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
-rw-r--r--drivers/scsi/qla2xxx/qla_isr.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index 09afc0f06bd4..5181d966fecb 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -909,6 +909,21 @@ qla2x00_status_entry(scsi_qla_host_t *ha, void *pkt)
resid = resid_len;
cp->resid = resid;
CMD_RESID_LEN(cp) = resid;
+
+ if (!lscsi_status &&
+ ((unsigned)(cp->request_bufflen - resid) <
+ cp->underflow)) {
+ qla_printk(KERN_INFO, ha,
+ "scsi(%ld:%d:%d:%d): Mid-layer underflow "
+ "detected (%x of %x bytes)...returning "
+ "error status.\n", ha->host_no,
+ cp->device->channel, cp->device->id,
+ cp->device->lun, resid,
+ cp->request_bufflen);
+
+ cp->result = DID_ERROR << 16;
+ break;
+ }
}
cp->result = DID_OK << 16 | lscsi_status;