From 09585f46fdc490d932e9753660a6ee8108acca10 Mon Sep 17 00:00:00 2001 From: Vasu Dev Date: Fri, 23 Jan 2009 02:27:33 -0800 Subject: libfc: IO data integrity issue when a IO data frame lost References: bnc#469536 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. Please ignore previously submitted patch fixing this issue differently at http://www.open-fcoe.org/pipermail/devel/2009-January/001543.html. Although that patch also fixed this issue but was causing unnecessary FC abort to trigger scsi-ml retry to recover from this underrun issue. Also bumped up module version to 1.0.7. Signed-off-by: Vasu Dev Signed-off-by: Hannes Reinecke --- drivers/scsi/fcoe/libfcoe.c | 2 +- drivers/scsi/libfc/fc_fcp.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) --- a/drivers/scsi/fcoe/libfcoe.c +++ b/drivers/scsi/fcoe/libfcoe.c @@ -60,7 +60,7 @@ static int debug_fcoe; MODULE_AUTHOR("Open-FCoE.org"); MODULE_DESCRIPTION("FCoE"); MODULE_LICENSE("GPL"); -MODULE_VERSION("1.0.6"); +MODULE_VERSION("1.0.7"); /* fcoe host list */ LIST_HEAD(fcoe_hostlist); --- a/drivers/scsi/libfc/fc_fcp.c +++ b/drivers/scsi/libfc/fc_fcp.c @@ -42,7 +42,7 @@ MODULE_AUTHOR("Open-FCoE.org"); MODULE_DESCRIPTION("libfc"); MODULE_LICENSE("GPL"); -MODULE_VERSION("1.0.6"); +MODULE_VERSION("1.0.7"); static int fc_fcp_debug; @@ -1811,12 +1811,12 @@ static void fc_io_compl(struct fc_fcp_pk 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