kern/134355: [mbuf] comments for m_getm2 inconsistent with
behaviour
vwe at FreeBSD.org
vwe at FreeBSD.org
Wed Jun 17 20:13:22 UTC 2009
Old Synopsis: [kernel] comments for m_getm2 inconsistent with behaviour
New Synopsis: [mbuf] comments for m_getm2 inconsistent with behaviour
State-Changed-From-To: open->analyzed
State-Changed-By: vwe
State-Changed-When: Wed Jun 17 20:07:52 UTC 2009
State-Changed-Why:
Martin,
thank you for your submission.
In the first place I thought you've found a code bug but while carefully
analyzing usage of m_getm2(), I haven't been able to to find a sign
of trouble. I agree current implementation isn't intentional and might
easily lead into misuse of m_getmw() but the function is rarely used.
I think the issue can be solved by "fixing" the leading comment by
something like the following.
--- uipc_mbuf.c.orig 2009-06-17 22:03:53.000000000 +0200
+++ uipc_mbuf.c 2009-06-17 22:06:24.000000000 +0200
@@ -90,8 +90,9 @@
* Allocate a given length worth of mbufs and/or clusters (whatever fits
* best) and return a pointer to the top of the allocated chain. If an
* existing mbuf chain is provided, then we will append the new chain
- * to the existing one but still return the top of the newly allocated
- * chain.
+ * to the existing one but still return the top of the pre-existing
+ * chain. If no pre-existing mbuf chain is given, we return the top
+ * of the new allocated mbuf chain.
*/
struct mbuf *
m_getm2(struct mbuf *m, int len, int how, short type, int flags)
http://www.freebsd.org/cgi/query-pr.cgi?pr=134355
More information about the freebsd-bugs
mailing list