Re: 3.5-rc3: BUG: Dentry still in use (1) [unmount of cgroupcgroup]

From: Tejun Heo
Date: Tue Jul 03 2012 - 13:10:34 EST

Hello, Al.

On Sat, Jun 30, 2012 at 09:34:21AM +0100, Al Viro wrote:
> Now that I've looked at that code again... What's the story with
> simple_unlink(d->d_inode, d);
> in cgroup_rm_file()? Wrong parent inode, at the very least...

Yeah, indeed. My mistake while refactoring the code. Will fix.

> While we are at it, what the hell is going on in
> static void cgroup_clear_directory(struct dentry *dir)
> {
> struct cgroup *cgrp = __d_cgrp(dir);
> while (!list_empty(&cgrp->files))
> cgroup_rm_file(cgrp, NULL);
> }
> Are you fighting some kind of race against somebody adding stuff
> there? Unless I'm seriously misreading cgroup_rm_file(), it'll
> do all the work on the first call...

cgroup_rm_file() finds the file matching @cft, deletes that one file
and returns. Passing in %NULL @cft makes it deletes the first file
but it still returns after deleting one. Maybe breaking up
list_for_each_entry() so that deletion and returning is outside the
loop would make that clearer.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at