Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 77055
b: refs/heads/master
c: 7207fea
h: refs/heads/master
i:
  77053: f1f39ac
  77051: 75d3d25
  77047: 0834609
  77039: bf4a9e0
  77023: ded6727
  76991: e92340e
  76927: ce8e065
  76799: 7464370
v: v3
  • Loading branch information
Boaz Harrosh authored and James Bottomley committed Jan 12, 2008
1 parent e6b8d70 commit 428c70b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: da32dd681f7a1a17073c42b375fc23cf73c92155
refs/heads/master: 7207fea452cfdd2d4e2f4419e2c31f570edbade3
16 changes: 7 additions & 9 deletions trunk/drivers/scsi/iscsi_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,22 +507,20 @@ iscsi_data_rsp(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask)
}

if (rhdr->flags & ISCSI_FLAG_DATA_STATUS) {
sc->result = (DID_OK << 16) | rhdr->cmd_status;
conn->exp_statsn = be32_to_cpu(rhdr->statsn) + 1;
if (rhdr->flags & ISCSI_FLAG_DATA_UNDERFLOW) {
if (rhdr->flags & (ISCSI_FLAG_DATA_UNDERFLOW |
ISCSI_FLAG_DATA_OVERFLOW)) {
int res_count = be32_to_cpu(rhdr->residual_count);

if (res_count > 0 &&
res_count <= scsi_bufflen(sc)) {
(rhdr->flags & ISCSI_FLAG_CMD_OVERFLOW ||
res_count <= scsi_bufflen(sc)))
scsi_set_resid(sc, res_count);
sc->result = (DID_OK << 16) | rhdr->cmd_status;
} else
else
sc->result = (DID_BAD_TARGET << 16) |
rhdr->cmd_status;
} else if (rhdr->flags & ISCSI_FLAG_DATA_OVERFLOW) {
scsi_set_resid(sc, be32_to_cpu(rhdr->residual_count));
sc->result = (DID_OK << 16) | rhdr->cmd_status;
} else
sc->result = (DID_OK << 16) | rhdr->cmd_status;
}
}

conn->datain_pdus_cnt++;
Expand Down
12 changes: 7 additions & 5 deletions trunk/drivers/scsi/libiscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,17 +291,19 @@ static void iscsi_scsi_cmd_rsp(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
min_t(uint16_t, senselen, SCSI_SENSE_BUFFERSIZE));
}

if (rhdr->flags & ISCSI_FLAG_CMD_UNDERFLOW) {
if (rhdr->flags & (ISCSI_FLAG_CMD_UNDERFLOW |
ISCSI_FLAG_CMD_OVERFLOW)) {
int res_count = be32_to_cpu(rhdr->residual_count);

if (res_count > 0 && res_count <= scsi_bufflen(sc))
if (res_count > 0 &&
(rhdr->flags & ISCSI_FLAG_CMD_OVERFLOW ||
res_count <= scsi_bufflen(sc)))
scsi_set_resid(sc, res_count);
else
sc->result = (DID_BAD_TARGET << 16) | rhdr->cmd_status;
} else if (rhdr->flags & ISCSI_FLAG_CMD_BIDI_UNDERFLOW)
} else if (rhdr->flags & (ISCSI_FLAG_CMD_BIDI_UNDERFLOW |
ISCSI_FLAG_CMD_BIDI_OVERFLOW))
sc->result = (DID_BAD_TARGET << 16) | rhdr->cmd_status;
else if (rhdr->flags & ISCSI_FLAG_CMD_OVERFLOW)
scsi_set_resid(sc, be32_to_cpu(rhdr->residual_count));

out:
debug_scsi("done [sc %lx res %d itt 0x%x]\n",
Expand Down

0 comments on commit 428c70b

Please sign in to comment.