Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752403AbWCPQrX (ORCPT ); Thu, 16 Mar 2006 11:47:23 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752402AbWCPQrW (ORCPT ); Thu, 16 Mar 2006 11:47:22 -0500 Received: from dsl093-040-174.pdx1.dsl.speakeasy.net ([66.93.40.174]:38635 "EHLO aria.kroah.org") by vger.kernel.org with ESMTP id S1751979AbWCPQrW (ORCPT ); Thu, 16 Mar 2006 11:47:22 -0500 Date: Thu, 16 Mar 2006 08:47:12 -0800 From: Greg KH To: "Artem B. Bityutskiy" Cc: linux-kernel , Thomas Gleixner Subject: Re: [Bug? Report] kref problem Message-ID: <20060316164712.GA10167@kroah.com> References: <1142509279.3920.31.camel@sauron.oktetlabs.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1142509279.3920.31.camel@sauron.oktetlabs.ru> User-Agent: Mutt/1.5.11 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1108 Lines: 37 On Thu, Mar 16, 2006 at 02:41:19PM +0300, Artem B. Bityutskiy wrote: > Hello Greg, > > I've hit on a kref problem Please, glance at the attached test module. > > The idea of the test is to create 2 kobjects (a and b), create dir A > with kobject A, and dir B with kobject B, so that A is B's parent. E.g., > we'll have /sys/A/B. > > I see the following output of the test: > > a inited, kref 1 > b inited, kref 1 > dir A created, A kref 1, B kref 1 > dir B created, A kref 1, B kref 1 > b_release > a_release > kobj B put, A kref 0, B kref 0 > kobj A put, A kref -1, B kref 0 > > > So what I don't like is this "A kref -1". Why when I remove directory B, > kobj a is released? For me it looks like a bug. Sample code please? Also, creating sysfs directories does not change the reference count on kobjects, they are two separate things. thanks, greg k-h - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/