Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 35024
b: refs/heads/master
c: ca51868
h: refs/heads/master
v: v3
  • Loading branch information
Mike Christie authored and James Bottomley committed Sep 2, 2006
1 parent 533f32e commit 52188db
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 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: db98ccde0881b8247acb52dece6d94ed770a7aa5
refs/heads/master: ca5186842a6d85e982e3d572ecd407453d0c5116
21 changes: 13 additions & 8 deletions trunk/drivers/scsi/iscsi_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -648,10 +648,9 @@ iscsi_ctask_copy(struct iscsi_tcp_conn *tcp_conn, struct iscsi_cmd_task *ctask,
* byte counters.
**/
static inline int
iscsi_tcp_copy(struct iscsi_conn *conn)
iscsi_tcp_copy(struct iscsi_conn *conn, int buf_size)
{
struct iscsi_tcp_conn *tcp_conn = conn->dd_data;
int buf_size = tcp_conn->in.datalen;
int buf_left = buf_size - tcp_conn->data_copied;
int size = min(tcp_conn->in.copy, buf_left);
int rc;
Expand Down Expand Up @@ -812,7 +811,7 @@ iscsi_data_recv(struct iscsi_conn *conn)
* Collect data segment to the connection's data
* placeholder
*/
if (iscsi_tcp_copy(conn)) {
if (iscsi_tcp_copy(conn, tcp_conn->in.datalen)) {
rc = -EAGAIN;
goto exit;
}
Expand Down Expand Up @@ -899,10 +898,15 @@ iscsi_tcp_data_recv(read_descriptor_t *rd_desc, struct sk_buff *skb,

debug_tcp("extra data_recv offset %d copy %d\n",
tcp_conn->in.offset, tcp_conn->in.copy);
skb_copy_bits(tcp_conn->in.skb, tcp_conn->in.offset,
&recv_digest, 4);
tcp_conn->in.offset += 4;
tcp_conn->in.copy -= 4;
rc = iscsi_tcp_copy(conn, sizeof(uint32_t));
if (rc) {
if (rc == -EAGAIN)
goto again;
iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED);
return 0;
}

memcpy(&recv_digest, conn->data, sizeof(uint32_t));
if (recv_digest != tcp_conn->in.datadgst) {
debug_tcp("iscsi_tcp: data digest error!"
"0x%x != 0x%x\n", recv_digest,
Expand Down Expand Up @@ -942,9 +946,10 @@ iscsi_tcp_data_recv(read_descriptor_t *rd_desc, struct sk_buff *skb,
&sg, 1);
}
crypto_digest_final(tcp_conn->rx_tfm,
(u8 *) & tcp_conn->in.datadgst);
(u8 *) &tcp_conn->in.datadgst);
debug_tcp("rx digest 0x%x\n", tcp_conn->in.datadgst);
tcp_conn->in_progress = IN_PROGRESS_DDIGEST_RECV;
tcp_conn->data_copied = 0;
} else
tcp_conn->in_progress = IN_PROGRESS_WAIT_HEADER;
}
Expand Down

0 comments on commit 52188db

Please sign in to comment.