cgroup: stash cgroup_root reference into cgroup_fs_context

Note that this reference is *NOT* contributing to refcount of
cgroup_root in question and is valid only until cgroup_do_mount()
returns.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Al Viro
2019-01-17 02:25:51 -05:00
parent e34a98d5b2
commit cf6299b1d0
3 changed files with 10 additions and 4 deletions
+3 -1
View File
@@ -1208,6 +1208,7 @@ int cgroup1_get_tree(struct fs_context *fc)
if (root->flags ^ ctx->flags)
pr_warn("new mount options do not match the existing superblock, will be ignored\n");
ctx->root = root;
ret = 0;
goto out_unlock;
}
@@ -1234,7 +1235,8 @@ int cgroup1_get_tree(struct fs_context *fc)
goto out_unlock;
}
init_cgroup_root(root, ctx);
ctx->root = root;
init_cgroup_root(ctx);
ret = cgroup_setup_root(root, ctx->subsys_mask);
if (ret)