[SCSI] libfc: fixed a read IO data integrity issue when a IO data frame lost

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Saturday, March 14, 2009 - 1:01 pm

Gitweb:     http://git.kernel.org/linus/26d9cab558f901051d0b69b2c445c8588931ce8d
Commit:     26d9cab558f901051d0b69b2c445c8588931ce8d
Parent:     6755db1cd4587084be85f860b7aa7c0cc9d776dc
Author:     Vasu Dev <vasu.dev@intel.com>
AuthorDate: Fri Feb 27 10:55:07 2009 -0800
Committer:  James Bottomley <James.Bottomley@HansenPartnership.com>
CommitDate: Fri Mar 6 15:40:06 2009 -0600

    [SCSI] libfc: fixed a read IO data integrity issue when a IO data frame lost
    
    The fc_fcp_complete_locked detected data underrun in this case and set
    the FC_DATA_UNDRUN but that was ignored by fc_io_compl for all cases
    including read underrun.
    
    Added code to not to ignore FC_DATA_UNDRUN for read IO and instead
    suggested scsi-ml to retry cmd to  recover from lost data frame.
    
    Not sure if it is okay to ignore FC_DATA_UNDRUN for other case, so let
    code as is for other cases but removed or-ing with zero valued fsp->cdb_status
    for those cases.
    
    Signed-off-by: Vasu Dev <vasu.dev@intel.com>
    Signed-off-by: Robert Love <robert.w.love@intel.com>
    Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
---
 drivers/scsi/libfc/fc_fcp.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c
index f440aac..ecc7261 100644
--- a/drivers/scsi/libfc/fc_fcp.c
+++ b/drivers/scsi/libfc/fc_fcp.c
@@ -1810,12 +1810,12 @@ static void fc_io_compl(struct fc_fcp_pkt *fsp)
 		sc_cmd->result = DID_ERROR << 16;
 		break;
 	case FC_DATA_UNDRUN:
-		if (fsp->cdb_status == 0) {
+		if ((fsp->cdb_status == 0) && !(fsp->req_flags & FC_SRB_READ)) {
 			/*
 			 * scsi status is good but transport level
-			 * underrun. for read it should be an error??
+			 * underrun.
 			 */
-			sc_cmd->result = (DID_OK << 16) | fsp->cdb_status;
+			sc_cmd->result = DID_OK << 16;
 		} else {
 			/*
 			 * scsi got underrun, this is an error
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[SCSI] libfc: fixed a read IO data integrity issue when a ..., Linux Kernel Mailing ..., (Sat Mar 14, 1:01 pm)