提交 9de99010 编写于 作者: B Bart Van Assche 提交者: Robert Love

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: NBart Van Assche <bvanassche@acm.org>
Cc: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: NRobert Love <robert.w.love@intel.com>
上级 7030fd62
...@@ -902,7 +902,8 @@ static void fc_fcp_resp(struct fc_fcp_pkt *fsp, struct fc_frame *fp) ...@@ -902,7 +902,8 @@ static void fc_fcp_resp(struct fc_fcp_pkt *fsp, struct fc_frame *fp)
/* /*
* Check for missing or extra data frames. * Check for missing or extra data frames.
*/ */
if (unlikely(fsp->xfer_len != expected_len)) { if (unlikely(fsp->cdb_status == SAM_STAT_GOOD &&
fsp->xfer_len != expected_len)) {
if (fsp->xfer_len < expected_len) { if (fsp->xfer_len < expected_len) {
/* /*
* Some data may be queued locally, * Some data may be queued locally,
...@@ -955,12 +956,11 @@ static void fc_fcp_complete_locked(struct fc_fcp_pkt *fsp) ...@@ -955,12 +956,11 @@ static void fc_fcp_complete_locked(struct fc_fcp_pkt *fsp)
* Test for transport underrun, independent of response * Test for transport underrun, independent of response
* underrun status. * underrun status.
*/ */
if (fsp->xfer_len < fsp->data_len && !fsp->io_status && if (fsp->cdb_status == SAM_STAT_GOOD &&
fsp->xfer_len < fsp->data_len && !fsp->io_status &&
(!(fsp->scsi_comp_flags & FCP_RESID_UNDER) || (!(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; fsp->status_code = FC_DATA_UNDRUN;
fsp->io_status = 0;
}
} }
seq = fsp->seq_ptr; seq = fsp->seq_ptr;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册