public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Boaz Harrosh <bharrosh@panasas.com>
To: Andrew Vasquez <andrew.vasquez@qlogic.com>
Cc: Linux SCSI Mailing List <linux-scsi@vger.kernel.org>,
	James Bottomley <james.bottomley@steeleye.com>,
	Seokmann Ju <seokmann.ju@qlogic.com>
Subject: Re: [PATCH 4/9] qla2xxx: Validate mid-layer 'underflow' during check-condition handling.
Date: Sun, 22 Jul 2007 13:50:21 +0300	[thread overview]
Message-ID: <46A3366D.9070807@panasas.com> (raw)
In-Reply-To: <11848827641168-git-send-email-andrew.vasquez@qlogic.com>

Andrew Vasquez wrote:
> From: Shyam Sundar <shyam.sundar@qlogic.com>
> 
> Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
> ---
>  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 fa21cd8..4a50b93 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)));
NACK. Breaks data buffers accessors patch. (385d70b4e2659ae525a00e46a9f97146949cfc14)
should be:

diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index fa21cd8..4a50b93 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)(scsi_bufflen(cp) - 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,
+				    scsi_bufflen(cp)));
+
+				cp->result = DID_ERROR << 16 | lscsi_status;
+			}
+
 			if (sense_len)
 				DEBUG5(qla2x00_dump_buffer(cp->sense_buffer,
 				    CMD_ACTUAL_SNSLEN(cp)));


  reply	other threads:[~2007-07-22 10:50 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-19 22:04 [PATCH 0/9] qla2xxx: updates for 2.6.23 [8.02.00-k2] Andrew Vasquez
2007-07-19 22:05 ` [PATCH 1/9] qla2xxx: Generalize FW-Interface-2 support Andrew Vasquez
2007-07-19 22:05 ` [PATCH 2/9] qla2xxx: Generalize iIDMA support Andrew Vasquez
2007-07-19 22:05 ` [PATCH 3/9] qla2xxx: Correct setting of 'current' and 'supported' speeds during FDMI registration Andrew Vasquez
2007-07-19 22:05 ` [PATCH 4/9] qla2xxx: Validate mid-layer 'underflow' during check-condition handling Andrew Vasquez
2007-07-22 10:50   ` Boaz Harrosh [this message]
2007-07-22 13:42     ` James Bottomley
2007-07-22 14:28       ` Boaz Harrosh
2007-07-23  0:27         ` Andrew Vasquez
2007-07-19 22:06 ` [PATCH 5/9] qla2xxx: Re-factor isp_operations to static structures Andrew Vasquez
2007-07-19 22:06 ` [PATCH 6/9] qla2xxx: Use PCI-X/PCI-Express read control interfaces Andrew Vasquez
2007-07-19 22:06 ` [PATCH 7/9] qla2xxx: Use pci_try_set_mwi() Andrew Vasquez
2007-07-19 22:06 ` [PATCH 8/9] qla2xxx: Add ISP25XX support Andrew Vasquez
2007-07-19 22:53   ` James Bottomley
2007-07-20  0:08     ` Andrew Vasquez
2007-07-20  3:37     ` [PATCH 8/9 TAKE2] " Andrew Vasquez
2007-07-19 22:06 ` [PATCH 9/9] qla2xxx: Update version number to 8.02.00-k2 Andrew Vasquez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46A3366D.9070807@panasas.com \
    --to=bharrosh@panasas.com \
    --cc=andrew.vasquez@qlogic.com \
    --cc=james.bottomley@steeleye.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=seokmann.ju@qlogic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox