From owner-freebsd-bugs@FreeBSD.ORG Fri Aug 21 18:55:43 2009 Return-Path: Delivered-To: freebsd-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC1DB106568F; Fri, 21 Aug 2009 18:55:43 +0000 (UTC) (envelope-from mkarsten@cs.uwaterloo.ca) Received: from services116.cs.uwaterloo.ca (services116.cs.uwaterloo.ca [129.97.152.169]) by mx1.freebsd.org (Postfix) with ESMTP id A7F958FC18; Fri, 21 Aug 2009 18:55:43 +0000 (UTC) Received: from kalli.uwaterloo.ca (kalli.uwaterloo.ca [129.97.168.4]) (authenticated bits=0) by services116.cs.uwaterloo.ca (8.13.8/8.13.8) with ESMTP id n7LIg7WC005511 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 21 Aug 2009 14:42:08 -0400 (EDT) Message-ID: <4A8EEA78.3040708@cs.uwaterloo.ca> Date: Fri, 21 Aug 2009 14:42:00 -0400 From: Martin Karsten User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090814 Fedora/3.0-2.6.b3.fc11 Thunderbird/3.0b3 MIME-Version: 1.0 To: vwe@FreeBSD.org References: <200906172013.n5HKDL4S004576@freefall.freebsd.org> In-Reply-To: <200906172013.n5HKDL4S004576@freefall.freebsd.org> X-Enigmail-Version: 0.97a Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Miltered: at mailchk-m04 with ID 4A8EEA7F.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Virus-Scanned: clamav-milter 0.95.2 at mailchk-r03 X-Virus-Status: Clean X-UUID: b465b5e9-c512-4f5a-ac89-4e3c2cd47bc4 Cc: freebsd-bugs@FreeBSD.org Subject: Re: kern/134355: [mbuf] comments for m_getm2 inconsistent with behaviour X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2009 18:55:44 -0000 I must have missed this email. Yes, changing the comment is definitely enough to rectify the inconsistency. Thanks, Martin On 06/17/2009 04:13 PM, vwe@FreeBSD.org wrote: > 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