]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
lib: ignore invalid mounts in cg_init_map
authorDmitry Yakunin <zeil@yandex-team.ru>
Thu, 8 Oct 2020 17:59:27 +0000 (20:59 +0300)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 12 Oct 2020 06:02:35 +0000 (23:02 -0700)
In case of bad entries in /proc/mounts just skip cgroup cache initialization.
Cgroups in output will be shown as "unreachable:cgroup_id".

Fixes: d5e6ee0dac64 ("ss: introduce cgroup2 cache and helper functions")
Signed-off-by: Dmitry Yakunin <zeil@yandex-team.ru>
Reported-by: Donald Sharp <sharpd@nvidia.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
lib/cg_map.c

index 77f030e38ba3eca468bc47809f22e7fdbec59a8d..39f244dbc5bdcafdc3b6646a22c487c6bebd6bc2 100644 (file)
@@ -96,11 +96,10 @@ static void cg_init_map(void)
 
        mnt = find_cgroup2_mount(false);
        if (!mnt)
-               exit(1);
+               return;
 
        mntlen = strlen(mnt);
-       if (nftw(mnt, nftw_fn, 1024, FTW_MOUNT) < 0)
-               exit(1);
+       (void) nftw(mnt, nftw_fn, 1024, FTW_MOUNT);
 
        free(mnt);
 }