From owner-freebsd-current@FreeBSD.ORG Sat Nov 5 19:47:25 2005 Return-Path: X-Original-To: freebsd-current@FreeBSD.org Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D2D5B16A41F for ; Sat, 5 Nov 2005 19:47:25 +0000 (GMT) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8303643D48 for ; Sat, 5 Nov 2005 19:47:24 +0000 (GMT) (envelope-from andre@freebsd.org) Received: (qmail 84427 invoked from network); 5 Nov 2005 19:49:52 -0000 Received: from c00l3r.networx.ch (HELO freebsd.org) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 5 Nov 2005 19:49:52 -0000 Message-ID: <436D0C52.7A02137F@freebsd.org> Date: Sat, 05 Nov 2005 20:47:30 +0100 From: Andre Oppermann X-Mailer: Mozilla 4.8 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: Gleb Smirnoff References: <20051104092724.GA33945@xor.obsecurity.org> <436B885B.6010609@freebsd.org> <20051104163526.GC82727@flame.pc> <200511041833.30955.thierry@herbelot.com> <436BA8B5.9070104@freebsd.org> <20051105003420.GM91530@cell.sick.ru> <20051105034105.GA906@flame.pc> <20051105080116.GR91530@cell.sick.ru> <20051105084924.GT91530@cell.sick.ru> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: sam@FreeBSD.org, freebsd-current@FreeBSD.org, Giorgos Keramidas , thierry@herbelot.com Subject: Re: panic: mb_dtor_pack: ref_cnt != 1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Nov 2005 19:47:25 -0000 Gleb Smirnoff wrote: > > On Sat, Nov 05, 2005 at 11:01:16AM +0300, Gleb Smirnoff wrote: > T> On Sat, Nov 05, 2005 at 05:41:05AM +0200, Giorgos Keramidas wrote: > T> G> On 2005-11-05 03:34, Gleb Smirnoff wrote: > T> G> > Andre, Thierry, Sam, > T> G> > > T> G> > this patch should fix the problems > T> G> > T> G> But it panics in mb_dtor_pack() because ext_type != EXT_CLUSTER > T> G> when my ath0 interface tries to associate with an AP. > T> G> > T> G> I had to change this too, to make things work: > T> > T> Updated patch. > > One more update. Since I have removed this block: > > if (*(m->m_ext.ref_cnt) == 0) > *(m->m_ext.ref_cnt) = 1; > > I have also altered KASSERT in mb_dtor_pack(). I don't like > inventing an incorrect invariant check and then adding helpers > to avoid it being triggered. This block is still required for the packet zone as the refcount is not re-initialized for mbuf+cluster out of the packet zone. You may up with wrong refcounts if you remove this check. It is not directly related to the KASSERT in mb_dtor_pack() but to the way atomic_fetchadd_int() works in concurrency situations. I have committed a fix to the same effect as your proposed patch. When UMA is fixed this may be reverted again. -- Andre