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

From: Paul Menage
Date: Tue Dec 16 2008 - 13:35:27 EST


On Tue, Dec 16, 2008 at 4:55 AM, Li Zefan <lizf@xxxxxxxxxxxxxx> 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
--
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/