From owner-svn-src-stable@FreeBSD.ORG Tue Nov 17 11:43:53 2009 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 5841F1065697; Tue, 17 Nov 2009 11:43:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 474378FC1E; Tue, 17 Nov 2009 11:43:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAHBhrC1005265; Tue, 17 Nov 2009 11:43:53 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAHBhrGW005263; Tue, 17 Nov 2009 11:43:53 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200911171143.nAHBhrGW005263@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 17 Nov 2009 11:43:53 +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: r199356 - stable/8/sys/kern 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: Tue, 17 Nov 2009 11:43:53 -0000 Author: kib Date: Tue Nov 17 11:43:53 2009 New Revision: 199356 URL: http://svn.freebsd.org/changeset/base/199356 Log: MFC r198853: If socket buffer space appears to be lower then sum of count of already prepared bytes and next portion of transfer, inner loop of kern_sendfile() aborts, not preparing next mbuf for socket buffer, and not modifying any outer loop invariants. The thread loops in the outer loop forever. Instead of breaking from inner loop, prepare only bytes that fit into the socket buffer space. Modified: stable/8/sys/kern/uipc_syscalls.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet6/ (props changed) Modified: stable/8/sys/kern/uipc_syscalls.c ============================================================================== --- stable/8/sys/kern/uipc_syscalls.c Tue Nov 17 11:39:15 2009 (r199355) +++ stable/8/sys/kern/uipc_syscalls.c Tue Nov 17 11:43:53 2009 (r199356) @@ -2036,20 +2036,12 @@ retry_space: rem = obj->un_pager.vnp.vnp_size - uap->offset - fsbytes - loopbytes; xfsize = omin(rem, xfsize); + xfsize = omin(space - loopbytes, xfsize); if (xfsize <= 0) { VM_OBJECT_UNLOCK(obj); done = 1; /* all data sent */ break; } - /* - * Don't overflow the send buffer. - * Stop here and send out what we've - * already got. - */ - if (space < loopbytes + xfsize) { - VM_OBJECT_UNLOCK(obj); - break; - } /* * Attempt to look up the page. Allocate