diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2016-08-25 13:59:17 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2016-08-25 13:59:17 +0000 |
commit | f12dd97e1a97a5dcad3c406c981408fd0b718dde (patch) | |
tree | 0879b5bdfe2033f81d71a322513f0978843f89e7 /sys/kern/uipc_socket.c | |
parent | 573a2fe4110b6b40f8504ffc4bd87c94d9eda4d9 (diff) |
Completely revert the M_WAIT change on the cluster allocation and
bring back the behaviour of rev 1.72. Although allocating small
mbufs when allocating an mbuf cluster fails seems suboptimal, this
should not be changed as a side effect when introducing m_getuio().
OK claudio@
Diffstat (limited to 'sys/kern/uipc_socket.c')
-rw-r--r-- | sys/kern/uipc_socket.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 498c5c28b48..70079038b0a 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_socket.c,v 1.153 2016/08/22 10:23:42 claudio Exp $ */ +/* $OpenBSD: uipc_socket.c,v 1.154 2016/08/25 13:59:16 bluhm Exp $ */ /* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */ /* @@ -542,14 +542,9 @@ m_getuio(struct mbuf **mp, int atomic, long space, struct uio *uio) resid = ulmin(resid, space); if (resid >= MINCLSIZE) { - mlen = ulmin(resid, MAXMCLBYTES); - MCLGETI(m, M_NOWAIT, NULL, mlen); - - if ((m->m_flags & M_EXT) == 0) { - /* should not happen */ - m_freem(top); - return (ENOBUFS); - } + MCLGETI(m, M_NOWAIT, NULL, ulmin(resid, MAXMCLBYTES)); + if ((m->m_flags & M_EXT) == 0) + goto nopages; mlen = m->m_ext.ext_size; len = ulmin(mlen, resid); /* @@ -559,6 +554,7 @@ m_getuio(struct mbuf **mp, int atomic, long space, struct uio *uio) if (atomic && top == NULL && len < mlen - max_hdr) m->m_data += max_hdr; } else { +nopages: len = ulmin(mlen, resid); /* * For datagram protocols, leave room |