mbuf(9): Restrict m_copyback() to forbid mbuf expansion
commit03c0424bef278cc2683866ae1f9071d7b9e16696
authorAaron LI <aly@aaronly.me>
Thu, 21 Dec 2023 01:44:28 +0000 (21 09:44 +0800)
committerAaron LI <aly@aaronly.me>
Fri, 22 Dec 2023 07:16:12 +0000 (22 15:16 +0800)
tree4c8f5a9fbbdd4ce406f20afaaaaee28ca51f1f80
parent10ab128c99d4c602bcf5e5a521f3cb30288ff8e1
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
share/man/man9/mbuf.9
sys/kern/uipc_mbuf.c
sys/sys/param.h