[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.0711291042240.4516-100000@iolanthe.rowland.org>
Date: Thu, 29 Nov 2007 10:47:19 -0500 (EST)
From: Alan Stern <stern@...land.harvard.edu>
To: Cornelia Huck <cornelia.huck@...ibm.com>
cc: Greg KH <greg@...ah.com>, <linux-kernel@...r.kernel.org>,
Kay Sievers <kay.sievers@...y.org>,
Jonathan Corbet <corbet@....net>,
Randy Dunlap <randy.dunlap@...cle.com>
Subject: Re: [RFC] New kobject/kset/ktype documentation and example code
On Thu, 29 Nov 2007, Cornelia Huck wrote:
> > The only problem arises when a child's driver retains a reference to
> > the parent kobject. If things are done properly, this reference should
> > involve incrementing the module count -- which would prevent the module
> > from being unloaded in the first place.
>
> This still leaves the possibility that random code may grab a reference
> once the kobject is present in the tree and lookupable. You gave up the
> control of the number of references to your object once you made it
> public.
I don't agree with this argument. Code should never grab random
references without insuring that the owner of the referenced object is
pinned. This rule applies to everything, not just kobjects.
Unfortunately kobjects don't have an owner field. In practice this
means that it isn't possible to pin the owner of some random kobject --
you have to know where the kobject came from or what it's embedded in.
All users of kobjects need to work this way.
Alan Stern
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists