• Tejun Heo's avatar
    cgroup: make cgroup_path() not print double slashes · da1f296f
    Tejun Heo authored
    While reimplementing cgroup_path(), 65dff759 ("cgroup: fix
    cgroup_path() vs rename() race") introduced a bug where the path of a
    non-root cgroup would have two slahses at the beginning, which is
    caused by treating the root cgroup which has the name '/' like
    non-root cgroups.
    
     $ grep systemd /proc/self/cgroup
     1:name=systemd://user/root/1
    
    Fix it by special casing root cgroup case and not looping over it in
    the normal path.
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    Cc: Li Zefan <lizefan@huawei.com>
    da1f296f
cgroup.c 145 KB