Re: [PATCH] sysfs: differentiate between locking links and non-links

From: Tejun Heo
Date: Thu Feb 11 2010 - 19:57:08 EST


Hello, Eric.

On 02/12/2010 03:08 AM, Eric W. Biederman wrote:
> I have been playing with it and so far the code doesn't seem too bad. I have
> however come across another misfeature of sysfs. sysfs_get_active_two appears
> to be unnecessary overkill.
>
> The purpose of the active references are to allows us to block when
> removing sysfs entries that have custom methods so we don't remove
> modules or those custom methods don't remove access data structures
> after the files have been removed. Further sysfs_remove_dir remove
> all elements in the directory before removing the directory itself, so
> there is no chance we will remove a directory with active children.
>
> Tejun do you know of any other reason we want sysfs_get_active_two?
>
> If not I think we can make active references apply exclusively to
> attributes.

Yeah, it's necessary for something which I can't remember from the top
of my head ATM. It maybe has something to do with attributes not
holding reference to the owning module while the parent kobj does.
I'll dig in but IIRC it's not there just for fun. Is it difficult to
do the lockdep annotation without removing get_active_two?

Thanks.

--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/