Always apply the root flags on mounting, both when the superblock is new and when an already extant superblock is being shared. Currently there's a bug in commit b3678086951a5 whereby the flags are only changed if the superblock wasn't new. The intention was originally to effect the change for a new superblock by having kernfs_fill_super() call back into the subclassing filesystem, but that never got completed. On further reflection, it's possibly better not to do that so that we don't have to revert the flag change if there's a later failure. Fixes: b3678086951a ("kernfs, sysfs, cgroup, intel_rdt: Support fs_context") Reported-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx> Signed-off-by: David Howells <dhowells@xxxxxxxxxx> cc: Andrei Vagin <avagin@xxxxxxxxx> --- kernel/cgroup/cgroup.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index a19f0fec9d82..ff6627ec1e3e 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -2044,12 +2044,8 @@ int cgroup_do_get_tree(struct fs_context *fc) fc->root = nsdentry; } - ret = 0; - if (ctx->kfc.new_sb_created) - goto out_cgrp; apply_cgroup_root_flags(ctx->flags); - return 0; - + ret = 0; out_cgrp: return ret; }