From owner-svn-src-all@FreeBSD.ORG Tue Dec 24 17:28:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1697A2EF; Tue, 24 Dec 2013 17:28:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0283112DB; Tue, 24 Dec 2013 17:28:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBOHSRAd093309; Tue, 24 Dec 2013 17:28:27 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBOHSRCw093308; Tue, 24 Dec 2013 17:28:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201312241728.rBOHSRCw093308@svn.freebsd.org> From: Alexander Motin Date: Tue, 24 Dec 2013 17:28:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259828 - head/sys/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Dec 2013 17:28:28 -0000 Author: mav Date: Tue Dec 24 17:28:27 2013 New Revision: 259828 URL: http://svnweb.freebsd.org/changeset/base/259828 Log: Fix a bug introduced at r259632, triggering infinite loop in some cases. Modified: head/sys/rpc/svc_vc.c Modified: head/sys/rpc/svc_vc.c ============================================================================== --- head/sys/rpc/svc_vc.c Tue Dec 24 16:46:06 2013 (r259827) +++ head/sys/rpc/svc_vc.c Tue Dec 24 17:28:27 2013 (r259828) @@ -555,7 +555,7 @@ svc_vc_backchannel_stat(SVCXPRT *xprt) * leaving the result in cd->mreq. If we don't have a complete record, leave * the partial result in cd->mreq and try to read more from the socket. */ -static void +static int svc_vc_process_pending(SVCXPRT *xprt) { struct cf_conn *cd = (struct cf_conn *) xprt->xp_p1; @@ -584,7 +584,7 @@ svc_vc_process_pending(SVCXPRT *xprt) } if (n < sizeof(uint32_t)) { so->so_rcv.sb_lowat = sizeof(uint32_t) - n; - return; + return (FALSE); } m_copydata(cd->mpending, 0, sizeof(header), (char *)&header); @@ -620,6 +620,7 @@ svc_vc_process_pending(SVCXPRT *xprt) } so->so_rcv.sb_lowat = imax(1, imin(cd->resid, so->so_rcv.sb_hiwat / 2)); + return (TRUE); } static bool_t @@ -642,8 +643,10 @@ svc_vc_recv(SVCXPRT *xprt, struct rpc_ms for (;;) { /* If we have no request ready, check pending queue. */ while (cd->mpending && - (cd->mreq == NULL || cd->resid != 0 || !cd->eor)) - svc_vc_process_pending(xprt); + (cd->mreq == NULL || cd->resid != 0 || !cd->eor)) { + if (!svc_vc_process_pending(xprt)) + break; + } /* Process and return complete request in cd->mreq. */ if (cd->mreq != NULL && cd->resid == 0 && cd->eor) {