svn commit: r274506 - projects/sendfile/sys/kern

Gleb Smirnoff glebius at FreeBSD.org
Fri Nov 14 15:36:49 UTC 2014


Author: glebius
Date: Fri Nov 14 15:36:48 2014
New Revision: 274506
URL: https://svnweb.freebsd.org/changeset/base/274506

Log:
  Avoid coalescing if new mbuf is normal, but previous one is M_NOTREADY.
  
  Sponsored by:	Nginx, Inc.

Modified:
  projects/sendfile/sys/kern/uipc_sockbuf.c

Modified: projects/sendfile/sys/kern/uipc_sockbuf.c
==============================================================================
--- projects/sendfile/sys/kern/uipc_sockbuf.c	Fri Nov 14 15:34:52 2014	(r274505)
+++ projects/sendfile/sys/kern/uipc_sockbuf.c	Fri Nov 14 15:36:48 2014	(r274506)
@@ -906,8 +906,8 @@ sbappendcontrol(struct sockbuf *sb, stru
  *
  * (2) The mbuf may be coalesced -- i.e., data in the mbuf may be copied into
  *     an mbuf already in the socket buffer.  This can occur if an
- *     appropriate mbuf exists, there is room, and no merging of data types
- *     will occur.
+ *     appropriate mbuf exists, there is room, both mbufs are not marked as
+ *     not ready, and no merging of data types will occur.
  *
  * (3) The mbuf may be appended to the end of the existing mbuf chain.
  *
@@ -937,6 +937,7 @@ sbcompress(struct sockbuf *sb, struct mb
 		    M_WRITABLE(n) &&
 		    ((sb->sb_flags & SB_NOCOALESCE) == 0) &&
 		    !(m->m_flags & M_NOTREADY) &&
+		    !(n->m_flags & M_NOTREADY) &&
 		    m->m_len <= MCLBYTES / 4 && /* XXX: Don't copy too much */
 		    m->m_len <= M_TRAILINGSPACE(n) &&
 		    n->m_type == m->m_type) {


More information about the svn-src-projects mailing list