git: staged mbuf(9): Restrict m_copyback() to forbid mbuf expansion

Aaron LI aly at crater.dragonflybsd.org
Fri Dec 22 00:31:27 PST 2023


commit 03c0424bef278cc2683866ae1f9071d7b9e16696
Author: Aaron LI <aly at aaronly.me>
Date:   Thu Dec 21 09:44:28 2023 +0800

    mbuf(9): Restrict m_copyback() to forbid mbuf expansion
    
    Most uses of m_copyback() are in-place updates to a portion (e.g., the
    header) of a packet, so no mbuf allocation is required.  It's more clear
    to make m_copyback() forbid mbuf expansion instead of let it implicitly
    do allocation with how=M_NOWAIT.  Due to the lack of a return value, the
    caller is hard to identify an m_copyback() failure, so diagnostics info
    will be printed to the console in that case.
    
    Change the original m_copyback2() to be an inline function, and
    implement both m_copyback() and m_copyback2() as wrappers of it.
    
    Bump __DragonFly_version for this behavior change.
    
    Discussed-with: dillon

Summary of changes:
 share/man/man9/mbuf.9 | 15 ++++++++-------
 sys/kern/uipc_mbuf.c  | 41 +++++++++++++++++++++++++----------------
 sys/sys/param.h       |  3 ++-
 3 files changed, 35 insertions(+), 24 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/03c0424bef278cc2683866ae1f9071d7b9e16696


-- 
DragonFly BSD source repository


More information about the Commits mailing list