lkml.org 
[lkml]   [2008]   [Feb]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRE: [2.6 patch] scsi/qla4xxx/ql4_isr.c: remove dead code
Date
From

Andrew Vasquez wrote:
<snip>
> > > Hmm, guess it's the earlier 'if (scsi_status == 0)' check
> a few lines
> > > up... Dave S., can you take a look at this... Thanks, av
> >
> > Ah, so the !scsi_status is wrong it was supposed to be
> scsi_status !=
> > 0 ... and even then it can just be dropped.
>
> My guess is that the check should have been written as:
>
> ...
> if (sts_entry->iscsiFlags &ISCSI_FLAG_RESIDUAL_UNDER)
> scsi_set_resid(cmd, residual);
> if ((scsi_bufflen(cmd) - residual) < cmd->underflow) {
> ...
>
> It looks to be a logic-error while porting from qla2xxx, where
> scsi_status during CS_COMPLETE is the full 16-bit status (high-byte is
> transport, low-byte SCSI status) from from the FCP_RSP frame (not so
> in iSCSI, where it's just the SCSI-status) and the residual check
> in qla_isr.c::qla2x00_status_entry() looks like:
>
> if (!lscsi_status &&
> ((unsigned)(scsi_bufflen(cp) - resid) <
> cp->underflow)) {
> ...
>
> I'll defer to Dave S. for verification.
>
The correct patch needs to be

Signed-off-by: David C Somayajulu <david.somayajulu@qlogic.com>

---

diff --git a/drivers/scsi/qla4xxx/ql4_isr.c
b/drivers/scsi/qla4xxx/ql4_isr.c
index 0f029d0..fc84db4 100644
--- a/drivers/scsi/qla4xxx/ql4_isr.c
+++ b/drivers/scsi/qla4xxx/ql4_isr.c
@@ -100,8 +100,7 @@ static void qla4xxx_status_entry(struct

if (sts_entry->iscsiFlags &ISCSI_FLAG_RESIDUAL_UNDER) {
scsi_set_resid(cmd, residual);
- if (!scsi_status && ((scsi_bufflen(cmd) -
residual) <
- cmd->underflow)) {
+ if ((scsi_bufflen(cmd) - residual) <
cmd->underflow) {

cmd->result = DID_ERROR << 16;


\
 
 \ /
  Last update: 2008-02-21 12:45    [W:0.044 / U:0.652 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site