[SCSI] iscsi: data under/over flow fix
We need to check the ISCSI_FLAG_DATA_* flags. Signed-off-by: Alex Aizman <itn780@yahoo.com> Signed-off-by: Dmitry Yusupov <dmitry_yus@yahoo.com> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
This commit is contained in:

committed by
James Bottomley

parent
42f72aa9e5
commit
bf310b8f58
@@ -357,7 +357,7 @@ iscsi_data_rsp(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask)
|
|||||||
struct scsi_cmnd *sc = ctask->sc;
|
struct scsi_cmnd *sc = ctask->sc;
|
||||||
|
|
||||||
conn->exp_statsn = be32_to_cpu(rhdr->statsn) + 1;
|
conn->exp_statsn = be32_to_cpu(rhdr->statsn) + 1;
|
||||||
if (rhdr->flags & ISCSI_FLAG_CMD_UNDERFLOW) {
|
if (rhdr->flags & ISCSI_FLAG_DATA_UNDERFLOW) {
|
||||||
int res_count = be32_to_cpu(rhdr->residual_count);
|
int res_count = be32_to_cpu(rhdr->residual_count);
|
||||||
|
|
||||||
if (res_count > 0 &&
|
if (res_count > 0 &&
|
||||||
@@ -367,9 +367,7 @@ iscsi_data_rsp(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask)
|
|||||||
} else
|
} else
|
||||||
sc->result = (DID_BAD_TARGET << 16) |
|
sc->result = (DID_BAD_TARGET << 16) |
|
||||||
rhdr->cmd_status;
|
rhdr->cmd_status;
|
||||||
} else if (rhdr->flags & ISCSI_FLAG_CMD_BIDI_UNDERFLOW)
|
} else if (rhdr->flags & ISCSI_FLAG_DATA_OVERFLOW) {
|
||||||
sc->result = (DID_BAD_TARGET << 16) | rhdr->cmd_status;
|
|
||||||
else if (rhdr->flags & ISCSI_FLAG_CMD_OVERFLOW) {
|
|
||||||
sc->resid = be32_to_cpu(rhdr->residual_count);
|
sc->resid = be32_to_cpu(rhdr->residual_count);
|
||||||
sc->result = (DID_OK << 16) | rhdr->cmd_status;
|
sc->result = (DID_OK << 16) | rhdr->cmd_status;
|
||||||
} else
|
} else
|
||||||
|
Reference in New Issue
Block a user