Re: [PATCH] cgroup: fix dentry still in use bug when dropping cssrefs after umount

From: Li Zefan
Date: Wed Jul 04 2012 - 02:00:46 EST


>> @@ -78,8 +79,8 @@ struct cgroup_subsys_state {

>> /* ID for this css, if possible */
>> struct css_id __rcu *id;
>>
>> - /* Used to put @cgroup->dentry on the last css_put() */
>> - struct work_struct dput_work;
>> + /* Used to put @cgroup->css_refs on the last css_put() */
>> + struct work_struct put_work;
>> };
>>
>> /* bits in struct cgroup_subsys_state flags field */
>> @@ -170,6 +171,9 @@ struct cgroup {
>> */
>> atomic_t count;
>>
>> + /* We won't destroy the cgroup when there are css refs */
>> + struct kref css_refs;
>> +
>> /*
>> * We link our 'sibling' struct into our parent's 'children'.
>> * Our children link their 'sibling' into our 'children'.
>
> Hmm... adding another layer of refcnting. Now we end up with three
> layers of refcnting - the active usage via cgroup->count, cgroup
> lifetime via cgroup->dentry->d_count and this extended lifecycle
> refcnt. In addition, we now have to deal with partially destroyed
> cgroups - e.g. running cgroup_path() will oops on lingering cgroups.
> Hating this tangling of dentries and cgroups more and more. :(
>


yeah, the fix you sent looks better.

--
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/