Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Mar 2017 16:01:31 +0800
From:      Julian Elischer <julian@freebsd.org>
To:        Alexander Motin <mav@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   Re: svn commit: r314465 - stable/11/sys/dev/iscsi
Message-ID:  <ec2ce67f-ae66-8e20-0199-2c02852e7b63@freebsd.org>
In-Reply-To: <201703010424.v214OU21019010@repo.freebsd.org>
References:  <201703010424.v214OU21019010@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Might be an idea to add a comment in a good place pointing out that 
that should not be unsigned
so that the next person doesn't make the same mistake..


On 1/3/17 12:24 pm, Alexander Motin wrote:
> Author: mav
> Date: Wed Mar  1 04:24:30 2017
> New Revision: 314465
> URL: https://svnweb.freebsd.org/changeset/base/314465
>
> Log:
>    MFC r313779: 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.
>
> Modified:
>    stable/11/sys/dev/iscsi/icl_soft.c
> Directory Properties:
>    stable/11/   (props changed)
>
> Modified: stable/11/sys/dev/iscsi/icl_soft.c
> ==============================================================================
> --- stable/11/sys/dev/iscsi/icl_soft.c	Wed Mar  1 04:24:24 2017	(r314464)
> +++ stable/11/sys/dev/iscsi/icl_soft.c	Wed Mar  1 04:24:30 2017	(r314465)
> @@ -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
>
>




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ec2ce67f-ae66-8e20-0199-2c02852e7b63>