Date: Wed, 17 Jun 2009 20:13:21 GMT From: vwe@FreeBSD.org To: mkarsten@cs.uwaterloo.ca, vwe@FreeBSD.org, freebsd-bugs@FreeBSD.org Subject: Re: kern/134355: [mbuf] comments for m_getm2 inconsistent with behaviour Message-ID: <200906172013.n5HKDL4S004576@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906172013.n5HKDL4S004576>