diff mbox

libfc: abort an exchange in case of underrun error

Message ID 20150318001207.11827.82460.stgit@lin-nd1-054.jf.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Dev, Vasu March 18, 2015, 12:12 a.m. UTC
Currently exchange is not aborted in case underrun, so this patch
fixes this by issuing exchange abort along FC_DATA_UNDRUN error since
such error-ed exchange must be aborted first before same can be re-used.

Tested-By: Jack Morgan<jack.morgan@intel.com>
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
---

 drivers/scsi/libfc/fc_fcp.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c
index c679594..9ad1248 100644
--- a/drivers/scsi/libfc/fc_fcp.c
+++ b/drivers/scsi/libfc/fc_fcp.c
@@ -959,8 +959,10 @@  static void fc_fcp_complete_locked(struct fc_fcp_pkt *fsp)
 		if (fsp->cdb_status == SAM_STAT_GOOD &&
 		    fsp->xfer_len < fsp->data_len && !fsp->io_status &&
 		    (!(fsp->scsi_comp_flags & FCP_RESID_UNDER) ||
-		     fsp->xfer_len < fsp->data_len - fsp->scsi_resid))
+		     fsp->xfer_len < fsp->data_len - fsp->scsi_resid)) {
 			fsp->status_code = FC_DATA_UNDRUN;
+			fc_fcp_send_abort(fsp);
+		}
 	}
 
 	seq = fsp->seq_ptr;