From 8edca8bbd170102ae3a4556a810cef6244a48663 Mon Sep 17 00:00:00 2001 From: sailorvii Date: Mon, 28 Feb 2022 10:03:09 +0800 Subject: [PATCH] kata-agent: Fix mismatching error of cgroup and mountinfo. The content about systemd in "/proc/self/cgroup" is as: 1:name=systemd:/kubepods/pod1815643d-3789-4e4e-aaf4-00de024912e1/0e15a65bd5f7b30a0b818d90706212354d8b3f0998a1495473c3be9a24706ccf and in "/prol/self/mountinfo" is as: 30 29 0:26 / /sys/fs/cgroup/systemd rw,nosuid,nodev,noexec,relatime shared:6 - cgroup cgroup rw,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd The keys extracted from the two files are the same as "name=systemd". So no need to rename the key to "systemd". Fixes: #3385 Signed-off-by: sailorvii --- src/agent/rustjail/src/cgroups/fs/mod.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/agent/rustjail/src/cgroups/fs/mod.rs b/src/agent/rustjail/src/cgroups/fs/mod.rs index b4cf73e31..b264e5e9d 100644 --- a/src/agent/rustjail/src/cgroups/fs/mod.rs +++ b/src/agent/rustjail/src/cgroups/fs/mod.rs @@ -905,13 +905,7 @@ pub fn get_paths() -> Result> { let keys: Vec<&str> = fl[1].split(',').collect(); for key in &keys { - // this is a workaround, cgroup file are using `name=systemd`, - // but if file system the name is `systemd` - if *key == "name=systemd" { - m.insert("systemd".to_string(), fl[2].to_string()); - } else { - m.insert(key.to_string(), fl[2].to_string()); - } + m.insert(key.to_string(), fl[2].to_string()); } } Ok(m)