cgroup: remove cgrp->kn check in css_populate_dir()
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Mon, 17 Jul 2023 14:39:23 +0000 (20:09 +0530)
committerTejun Heo <tj@kernel.org>
Mon, 17 Jul 2023 18:44:56 +0000 (08:44 -1000)
cgroup_create() creates cgrp and assigns the kernfs_node to cgrp->kn,
then cgroup_mkdir() populates base and csses cft file by calling
css_populate_dir() and cgroup_apply_control_enable() with a valid
cgrp->kn. Check for NULL cgrp->kn, will always be false, remove it.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/cgroup/cgroup.c

index aa2cc32e60c0a779af1d26111d2f44de094c9ee8..3c1bb9ecea105f4c2804b02d7422c8d822b0b3bf 100644 (file)
@@ -1714,7 +1714,7 @@ static int css_populate_dir(struct cgroup_subsys_state *css)
        struct cftype *cfts, *failed_cfts;
        int ret;
 
-       if ((css->flags & CSS_VISIBLE) || !cgrp->kn)
+       if (css->flags & CSS_VISIBLE)
                return 0;
 
        if (!css->ss) {