diff options
author | Shyam Sundar <shyam.sundar@qlogic.com> | 2007-07-20 00:05:59 +0200 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.localdomain> | 2007-07-20 16:24:04 +0200 |
commit | 8084fe168a5252548cdddf2ed181c337fecd0523 (patch) | |
tree | 87e1c9c175972bfd7ca00963b3eb64c714e3c125 /drivers | |
parent | [SCSI] qla2xxx: Correct setting of 'current' and 'supported' speeds during FD... (diff) | |
download | linux-8084fe168a5252548cdddf2ed181c337fecd0523.tar.xz linux-8084fe168a5252548cdddf2ed181c337fecd0523.zip |
[SCSI] qla2xxx: Validate mid-layer 'underflow' during check-condition handling.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_isr.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index fa21cd86e9e2..4a50b931ca6f 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -1062,6 +1062,25 @@ qla2x00_status_entry(scsi_qla_host_t *ha, void *pkt) cp->device->id, cp->device->lun, cp, cp->serial_number)); + /* + * In case of a Underrun condition, set both the lscsi + * status and the completion status to appropriate + * values. + */ + if (resid && + ((unsigned)(cp->request_bufflen - resid) < + cp->underflow)) { + DEBUG2(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 | lscsi_status; + } + if (sense_len) DEBUG5(qla2x00_dump_buffer(cp->sense_buffer, CMD_ACTUAL_SNSLEN(cp))); |