Re: [PATCH] sched: fix another race when reading /proc/sched_debug

Paul Menage
2008-12-16T18:35:26Z

On Tue, Dec 16, 2008 at 4:55 AM, Li Zefan <lizf@cn.fujitsu.com> wrote:
>
> This avoids accessing a destroyed cgroup, but still race with cgroup_create.
> You sugguested call cgroup_create_dir() before calling subsystems' create()
> method.
>

I think that if we need a fix for 2.6.28 I'll just make cgroup_path()
check for a NULL dentry in the passed cgroup, rather than shuffling
any code around. That combined with a simple RCU free in
cgroup_diput() should do the trick - I think I'll leave the existing
synchronize_rcu() at the beginning of cgroup_diput() in case we need
it for more reasons than I originally mentioned in the comment there.

Paul