Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Jun 2017 08:42:31 +0200
From:      Hans Petter Selasky <hps@selasky.org>
To:        Conrad Meyer <cem@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r320415 - head/sys/kern
Message-ID:  <d836c59a-3cc5-2ab3-c8ce-8636f0e7b8f5@selasky.org>
In-Reply-To: <201706271723.v5RHNKbU025676@repo.freebsd.org>
References:  <201706271723.v5RHNKbU025676@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 06/27/17 19:23, Conrad Meyer wrote:
> Author: cem
> Date: Tue Jun 27 17:23:20 2017
> New Revision: 320415
> URL: https://svnweb.freebsd.org/changeset/base/320415
> 
> Log:
>    Fix one more place uio_resid is truncated to int


Hi,

Should you use:

sys/sys/param.h:#define	MIN(a,b) (((a)<(b))?(a):(b))

Instead?

--HPS

>    
>    A follow-up to r231949 and r194990.
>    
>    Reported by:	pho@
>    Reviewed by:	kib@, markj@
>    Sponsored by:	Dell EMC Isilon
>    Differential Revision:	https://reviews.freebsd.org/D11373
> 
> Modified:
>    head/sys/kern/uipc_mbuf.c
> 
> Modified: head/sys/kern/uipc_mbuf.c
> ==============================================================================
> --- head/sys/kern/uipc_mbuf.c	Tue Jun 27 17:22:03 2017	(r320414)
> +++ head/sys/kern/uipc_mbuf.c	Tue Jun 27 17:23:20 2017	(r320415)
> @@ -1517,7 +1517,7 @@ m_uiotombuf(struct uio *uio, int how, int len, int ali
>   	 * the total data supplied by the uio.
>   	 */
>   	if (len > 0)
> -		total = min(uio->uio_resid, len);
> +		total = (uio->uio_resid < len) ? uio->uio_resid : len;
>   	else
>   		total = uio->uio_resid;
>   
> 
> 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d836c59a-3cc5-2ab3-c8ce-8636f0e7b8f5>