mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-18 03:01:26 +00:00
Merge of trunk r2236:
Fix for incorrect initialization of conn->read_msg.msg_iovlen. But looks like this value is rather ignored in the TCP stack and read_size used instead, so all worked fine. Noticed by yue <ooolinux@163.com> git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.0.0.x@2237 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -1563,16 +1563,16 @@ static int cmnd_prepare_recv_pdu(struct iscsi_conn *conn,
|
||||
conn->read_iov[i].iov_base = addr + offset;
|
||||
|
||||
if (size <= sg_len) {
|
||||
TRACE_DBG("idx=%d, offset=%u, size=%d, addr=%p",
|
||||
idx, offset, size, addr);
|
||||
TRACE_DBG("idx=%d, i=%d, offset=%u, size=%d, addr=%p",
|
||||
idx, i, offset, size, addr);
|
||||
conn->read_iov[i].iov_len = size;
|
||||
conn->read_msg.msg_iovlen = i;
|
||||
conn->read_msg.msg_iovlen = i+1;
|
||||
break;
|
||||
}
|
||||
conn->read_iov[i].iov_len = sg_len;
|
||||
|
||||
TRACE_DBG("idx=%d, offset=%u, size=%d, sg_len=%u, addr=%p",
|
||||
idx, offset, size, sg_len, addr);
|
||||
TRACE_DBG("idx=%d, i=%d, offset=%u, size=%d, sg_len=%u, "
|
||||
"addr=%p", idx, i, offset, size, sg_len, addr);
|
||||
|
||||
size -= sg_len;
|
||||
buff_offs += sg_len;
|
||||
|
||||
@@ -715,6 +715,9 @@ restart:
|
||||
MSG_DONTWAIT | MSG_NOSIGNAL);
|
||||
set_fs(oldfs);
|
||||
|
||||
TRACE_DBG("msg_iovlen %d, first_len %d, read_size %d, res %d",
|
||||
msg.msg_iovlen, first_len, conn->read_size, res);
|
||||
|
||||
if (res > 0) {
|
||||
/*
|
||||
* To save some considerable effort and CPU power we
|
||||
@@ -729,6 +732,7 @@ restart:
|
||||
if (conn->read_size != 0) {
|
||||
if (res >= first_len) {
|
||||
int done = 1 + ((res - first_len) >> PAGE_SHIFT);
|
||||
TRACE_DBG("done %d", done);
|
||||
conn->read_msg.msg_iov += done;
|
||||
conn->read_msg.msg_iovlen -= done;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user