From owner-svn-src-stable@FreeBSD.ORG Sun Apr 24 21:27:29 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3E891065672; Sun, 24 Apr 2011 21:27:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 93B6D8FC15; Sun, 24 Apr 2011 21:27:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3OLRTDc047812; Sun, 24 Apr 2011 21:27:29 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3OLRTTL047810; Sun, 24 Apr 2011 21:27:29 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201104242127.p3OLRTTL047810@svn.freebsd.org> From: Rick Macklem Date: Sun, 24 Apr 2011 21:27:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220999 - stable/8/lib/libc/rpc X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 21:27:29 -0000 Author: rmacklem Date: Sun Apr 24 21:27:29 2011 New Revision: 220999 URL: http://svn.freebsd.org/changeset/base/220999 Log: MFC: r220519 Fix a bug in the userland rpc library, where it would use a negative return value from write to update its position in a buffer. The patch, courtesy of Andrey Simonenko, also simplifies a conditional by removing the "i != cnt" clause, since it is always true at this point in the code. The bug caused problems for mountd, when it generated a large reply to an exports RPC request. Modified: stable/8/lib/libc/rpc/svc_vc.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/rpc/svc_vc.c ============================================================================== --- stable/8/lib/libc/rpc/svc_vc.c Sun Apr 24 19:50:13 2011 (r220998) +++ stable/8/lib/libc/rpc/svc_vc.c Sun Apr 24 21:27:29 2011 (r220999) @@ -546,7 +546,7 @@ write_vc(xprtp, buf, len) cd->strm_stat = XPRT_DIED; return (-1); } - if (cd->nonblock && i != cnt) { + if (cd->nonblock) { /* * For non-blocking connections, do not * take more than 2 seconds writing the @@ -560,6 +560,7 @@ write_vc(xprtp, buf, len) return (-1); } } + i = 0; } }