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.mor...@intel.com>
Signed-off-by: Vasu Dev <vasu....@intel.com>
---

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

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;

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

Reply via email to