diff options
author | Tejun Heo <tj@kernel.org> | 2012-11-19 16:13:36 (GMT) |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2012-11-19 16:13:36 (GMT) |
commit | 4e139afc22cb98d0d032ffce0285bfcc73ca5217 (patch) | |
tree | 51577f433405360504dc67b0f3b0c49afcef36ca /include/linux/cgroup.h | |
parent | 28fd6f30ac3efd9170ae1ac89f3521d53b5eb83a (diff) | |
download | linux-fsl-qoriq-4e139afc22cb98d0d032ffce0285bfcc73ca5217.tar.xz |
cgroup: create directory before linking while creating a new cgroup
While creating a new cgroup, cgroup_create() links the newly allocated
cgroup into various places before trying to create its directory.
Because cgroup life-cycle is tied to the vfs objects, this makes it
impossible to use cgroup_rmdir() for rolling back creation - the
removal logic depends on having full vfs objects.
This patch moves directory creation above linking and collect linking
operations to one place. This allows directory creation failure to
share error exit path with css allocation failures and any failure
sites afterwards (to be added later) can use cgroup_rmdir() logic to
undo creation.
Note that this also makes the memory barriers around cgroup->dentry,
which currently is misleadingly using RCU operations, unnecessary.
This will be handled in the next patch.
While at it, locking BUG_ON() on i_mutex is converted to
lockdep_assert_held().
v2: Patch originally removed %NULL dentry check in cgroup_path();
however, Li pointed out that this patch doesn't make it
unnecessary as ->create() may call cgroup_path(). Drop the
change for now.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Li Zefan <lizefan@huawei.com>
Diffstat (limited to 'include/linux/cgroup.h')
0 files changed, 0 insertions, 0 deletions