From 4b37cd93f86e72feac866442988b549b5b7bf3e6 Mon Sep 17 00:00:00 2001 From: lifubang Date: Thu, 8 May 2025 15:13:04 +0000 Subject: [PATCH] libct: align param type for mountCgroupV1/V2 functions Signed-off-by: lifubang --- libcontainer/rootfs_linux.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libcontainer/rootfs_linux.go b/libcontainer/rootfs_linux.go index 398b40c3d..ec3c77232 100644 --- a/libcontainer/rootfs_linux.go +++ b/libcontainer/rootfs_linux.go @@ -297,8 +297,8 @@ func cleanupTmp(tmpdir string) { _ = os.RemoveAll(tmpdir) } -func mountCgroupV1(m *configs.Mount, c *mountConfig) error { - binds, err := getCgroupMounts(m) +func mountCgroupV1(m mountEntry, c *mountConfig) error { + binds, err := getCgroupMounts(m.Mount) if err != nil { return err } @@ -368,7 +368,7 @@ func mountCgroupV1(m *configs.Mount, c *mountConfig) error { return nil } -func mountCgroupV2(m *configs.Mount, c *mountConfig) error { +func mountCgroupV2(m mountEntry, c *mountConfig) error { err := utils.WithProcfd(c.root, m.Destination, func(dstFd string) error { return mountViaFds(m.Source, nil, m.Destination, dstFd, "cgroup2", uintptr(m.Flags), m.Data) }) @@ -739,9 +739,9 @@ func mountToRootfs(c *mountConfig, m mountEntry) error { return setRecAttr(m.Mount, rootfs) case "cgroup": if cgroups.IsCgroup2UnifiedMode() { - return mountCgroupV2(m.Mount, c) + return mountCgroupV2(m, c) } - return mountCgroupV1(m.Mount, c) + return mountCgroupV1(m, c) default: return mountPropagate(m, rootfs, mountLabel) }