From a4afb37ba760e6ba0fc3d302279b4a2db850f803 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Wed, 18 Mar 2026 17:17:27 -0700 Subject: [PATCH] libct: mountCgroupV1: address TODO Indeed, it does not make sense to prepend c.root once we started using MkdirAllInRoot in commit 63c29081. Signed-off-by: Kir Kolyshkin (cherry picked from commit 60352524d346721b6a8640772e9b6e23e01a6ffa) Signed-off-by: lifubang --- libcontainer/rootfs_linux.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libcontainer/rootfs_linux.go b/libcontainer/rootfs_linux.go index 7aaa70d10..938a8078e 100644 --- a/libcontainer/rootfs_linux.go +++ b/libcontainer/rootfs_linux.go @@ -336,10 +336,8 @@ func mountCgroupV1(m mountEntry, c *mountConfig) error { // We just created the tmpfs, and so we can just use filepath.Join // here (not to mention we want to make sure we create the path // inside the tmpfs, so we don't want to resolve symlinks). - // TODO: Why not just use b.Destination (c.root is the root here)? - subsystemPath := filepath.Join(c.root, b.Destination) subsystemName := filepath.Base(b.Destination) - subsystemDir, err := pathrs.MkdirAllInRoot(c.root, subsystemPath, 0o755) + subsystemDir, err := pathrs.MkdirAllInRoot(c.root, b.Destination, 0o755) if err != nil { return err }