hulk inclusion category: feature bugzilla: https://atomgit.com/openeuler/kernel/issues/8420 ------------------ Signed-off-by: Zeng Heng <zengheng4@huawei.com> --- fs/resctrl/rdtgroup.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c index cb139678fef0..60c63a52ac9a 100644 --- a/fs/resctrl/rdtgroup.c +++ b/fs/resctrl/rdtgroup.c @@ -2693,10 +2693,6 @@ static int rdt_get_tree(struct fs_context *fc) goto out; } - ret = rdtgroup_setup_root(ctx); - if (ret) - goto out; - ret = rdt_enable_ctx(ctx); if (ret) goto out_root; @@ -2709,6 +2705,14 @@ static int rdt_get_tree(struct fs_context *fc) if (ret) goto out_schemata_free; + /* + * Should be called after schemata_list_create() and + * closid_init(). + */ + ret = rdtgroup_setup_root(ctx); + if (ret) + goto out; + if (resctrl_arch_mon_capable()) flags |= RFTYPE_MON; @@ -3981,7 +3985,7 @@ static int rdtgroup_setup_root(struct rdt_fs_context *ctx) ctx->kfc.root = rdt_root; rdtgroup_default.kn = kernfs_root_to_node(rdt_root); - return 0; + return rdtgroup_init_alloc(&rdtgroup_default); } static void rdtgroup_destroy_root(void) -- 2.25.1