aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2013-08-14 11:40:49 -0400
committerRobert Love <robert.w.love@intel.com>2013-09-04 16:52:35 -0400
commit9de99010cbebca4d4343117eff1af9a64d5d4896 (patch)
tree6bad11ab41ca473e1b28352d0e66eed457e494b8 /drivers/scsi
parent7030fd626129ec4d616784516a462d317c251d39 (diff)
fcp: Do not interpret check condition as underrun
This patch avoids that the FCoE initiator sends a REC message after having received a SCSI response with non-zero status and non-zero DATA IN buffer length. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Cc: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: Robert Love <robert.w.love@intel.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/libfc/fc_fcp.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c
index 5fd0f1fbe586..1d7e76e8b447 100644
--- a/drivers/scsi/libfc/fc_fcp.c
+++ b/drivers/scsi/libfc/fc_fcp.c
@@ -902,7 +902,8 @@ static void fc_fcp_resp(struct fc_fcp_pkt *fsp, struct fc_frame *fp)
902 /* 902 /*
903 * Check for missing or extra data frames. 903 * Check for missing or extra data frames.
904 */ 904 */
905 if (unlikely(fsp->xfer_len != expected_len)) { 905 if (unlikely(fsp->cdb_status == SAM_STAT_GOOD &&
906 fsp->xfer_len != expected_len)) {
906 if (fsp->xfer_len < expected_len) { 907 if (fsp->xfer_len < expected_len) {
907 /* 908 /*
908 * Some data may be queued locally, 909 * Some data may be queued locally,
@@ -955,12 +956,11 @@ static void fc_fcp_complete_locked(struct fc_fcp_pkt *fsp)
955 * Test for transport underrun, independent of response 956 * Test for transport underrun, independent of response
956 * underrun status. 957 * underrun status.
957 */ 958 */
958 if (fsp->xfer_len < fsp->data_len && !fsp->io_status && 959 if (fsp->cdb_status == SAM_STAT_GOOD &&
960 fsp->xfer_len < fsp->data_len && !fsp->io_status &&
959 (!(fsp->scsi_comp_flags & FCP_RESID_UNDER) || 961 (!(fsp->scsi_comp_flags & FCP_RESID_UNDER) ||
960 fsp->xfer_len < fsp->data_len - fsp->scsi_resid)) { 962 fsp->xfer_len < fsp->data_len - fsp->scsi_resid))
961 fsp->status_code = FC_DATA_UNDRUN; 963 fsp->status_code = FC_DATA_UNDRUN;
962 fsp->io_status = 0;
963 }
964 } 964 }
965 965
966 seq = fsp->seq_ptr; 966 seq = fsp->seq_ptr;