svn commit: r313779 - head/sys/dev/iscsi
Alexander Motin
mav at FreeBSD.org
Wed Feb 15 19:46:02 UTC 2017
Author: mav
Date: Wed Feb 15 19:46:00 2017
New Revision: 313779
URL: https://svnweb.freebsd.org/changeset/base/313779
Log:
Fix handling of negative sbspace() return values.
I found that at least with Chelsio NICs TOE sockets quite often report
negative sbspace() values. Using unsigned variable to store it resulted
in attempts to aggregate too much data in one sosend() call, that caused
errors and following connection termination.
MFC after: 2 weeks
Modified:
head/sys/dev/iscsi/icl_soft.c
Modified: head/sys/dev/iscsi/icl_soft.c
==============================================================================
--- head/sys/dev/iscsi/icl_soft.c Wed Feb 15 18:31:09 2017 (r313778)
+++ head/sys/dev/iscsi/icl_soft.c Wed Feb 15 19:46:00 2017 (r313779)
@@ -892,7 +892,7 @@ icl_conn_send_pdus(struct icl_conn *ic,
{
struct icl_pdu *request, *request2;
struct socket *so;
- size_t available, size, size2;
+ long available, size, size2;
int coalesced, error;
ICL_CONN_LOCK_ASSERT_NOT(ic);
@@ -931,7 +931,7 @@ icl_conn_send_pdus(struct icl_conn *ic,
if (available < size) {
#if 1
ICL_DEBUG("no space to send; "
- "have %zd, need %zd",
+ "have %ld, need %ld",
available, size);
#endif
so->so_snd.sb_lowat = size;
@@ -978,7 +978,7 @@ icl_conn_send_pdus(struct icl_conn *ic,
}
#if 0
if (coalesced > 1) {
- ICL_DEBUG("coalesced %d PDUs into %zd bytes",
+ ICL_DEBUG("coalesced %d PDUs into %ld bytes",
coalesced, size);
}
#endif
More information about the svn-src-all
mailing list