Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Nov 2009 13:00:10 GMT
From:      dfilter@FreeBSD.ORG (dfilter service)
To:        freebsd-net@FreeBSD.org
Subject:   Re: kern/138999: commit references a PR
Message-ID:  <200911031300.nA3D0AF5019032@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/138999; it has been noted by GNATS.

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/138999: commit references a PR
Date: Tue,  3 Nov 2009 12:52:49 +0000 (UTC)

 Author: kib
 Date: Tue Nov  3 12:52:35 2009
 New Revision: 198853
 URL: http://svn.freebsd.org/changeset/base/198853
 
 Log:
   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.
   
   In collaboration with:	pho
   Reviewed by:	bz
   PR:	kern/138999
   MFC after:	2 weeks
 
 Modified:
   head/sys/kern/uipc_syscalls.c
 
 Modified: head/sys/kern/uipc_syscalls.c
 ==============================================================================
 --- head/sys/kern/uipc_syscalls.c	Tue Nov  3 12:03:13 2009	(r198852)
 +++ head/sys/kern/uipc_syscalls.c	Tue Nov  3 12:52:35 2009	(r198853)
 @@ -2037,20 +2037,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
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200911031300.nA3D0AF5019032>