Perhaps it would make the code a lot clearer to separate out the caller_is_in_ancestor from the "get_next_visible_parent_cgroup" function.
To rephrase dome of comment #9,
Assume again task is in /a/b. If it does:
opendir(/a) it should see only b
opendir(/c) it should get ENOENT
opendir(/a/b/c) it should see full contents
stat/open/chown/chmod(/a/tasks) should get ENOENT
stat/open/chown/chmod(/a/b/tasks) should act on the tasks file
mkdir(/c) should get EPERM
rmdir(/c) should get ENOENT
mkdir(/a) should get EEXIST
rmdir(/a) should get EBUSY
Perhaps it would make the code a lot clearer to separate out the caller_ is_in_ancestor from the "get_next_ visible_ parent_ cgroup" function.
To rephrase dome of comment #9,
Assume again task is in /a/b. If it does:
opendir(/a) it should see only b chown/chmod( /a/tasks) should get ENOENT chown/chmod( /a/b/tasks) should act on the tasks file
opendir(/c) it should get ENOENT
opendir(/a/b/c) it should see full contents
stat/open/
stat/open/
mkdir(/c) should get EPERM
rmdir(/c) should get ENOENT
mkdir(/a) should get EEXIST
rmdir(/a) should get EBUSY