diff options
author | Dmitry Yakunin <zeil@yandex-team.ru> | 2020-10-08 20:59:27 +0300 |
---|---|---|
committer | Stephen Hemminger <stephen@networkplumber.org> | 2020-10-11 23:02:35 -0700 |
commit | 58c3c55f3888fd2482545dfc902b9cb38458e404 (patch) | |
tree | 47a79b0ee31294ed67a718ba39f0155402287704 | |
parent | 003b9af5163e82b8e601fc90e8ac2d7e18a021d8 (diff) |
lib: ignore invalid mounts in cg_init_map
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>
-rw-r--r-- | lib/cg_map.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/cg_map.c b/lib/cg_map.c index 77f030e3..39f244db 100644 --- a/lib/cg_map.c +++ b/lib/cg_map.c @@ -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); } |