From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Subject: Re: netfilter: active obj WARN when cleaning up Date: Mon, 2 Dec 2013 08:40:39 -0800 Message-ID: <20131202164039.GA19937@kroah.com> References: <5294F27D.4000108@oracle.com> <20131126230709.GA10948@localhost> <20131127113939.GL16735@n2100.arm.linux.org.uk> <20131127133231.GO16735@n2100.arm.linux.org.uk> <20131127134015.GA6011@n2100.arm.linux.org.uk> <20131127233415.GB19270@kroah.com> <00000142b4282aaf-913f5e4c-314c-4351-9d24-615e66928157-000000@email.amazonses.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Thomas Gleixner , Russell King - ARM Linux , Pablo Neira Ayuso , Sasha Levin , Patrick McHardy , kadlec@blackhole.kfki.hu, "David S. Miller" , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, LKML , linux-mm@kvack.org, Andrew Morton To: Christoph Lameter Return-path: Received: from out1-smtp.messagingengine.com ([66.111.4.25]:41221 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751964Ab3LBQkm (ORCPT ); Mon, 2 Dec 2013 11:40:42 -0500 Content-Disposition: inline In-Reply-To: <00000142b4282aaf-913f5e4c-314c-4351-9d24-615e66928157-000000@email.amazonses.com> Sender: netfilter-devel-owner@vger.kernel.org List-ID: On Mon, Dec 02, 2013 at 04:33:20PM +0000, Christoph Lameter wrote: > On Wed, 27 Nov 2013, Greg KH wrote: > > > Just make the kobject "dynamic" instead of embedded in struct kmem_cache > > and all will be fine. I can't believe this code has been broken for > > this long. > > The slub code is was designed to use an embedded structure since we > only get the kobj pointer passed to us from sysfs. If kobj is not > embedded then how can we get from the sysfs object to the kmem_cache > structure from the sysfs callbacks? Sysfs was designed to have embedded > objects as far as I can recall. Yes, it's designed to have embedded objects, so then use it that way and clean up the structure when the kobject goes away. Don't use a different reference count for your structure than the one in the kobject and think that all will be fine. greg k-h