29 lines
962 B
Diff
29 lines
962 B
Diff
From 29a2bfe1e6197dd79a02e4e2a443ba21bc80c080 Mon Sep 17 00:00:00 2001
|
|
From: zhongjiawei <zhongjiawei1@huawei.com>
|
|
Date: Sun, 29 Sep 2024 15:01:34 +0800
|
|
Subject: [PATCH] runc:fix can't set cpuset-cpus and cpuset-mems at the same
|
|
time
|
|
|
|
---
|
|
libcontainer/cgroups/fs/cpuset.go | 4 +++-
|
|
1 file changed, 3 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/libcontainer/cgroups/fs/cpuset.go b/libcontainer/cgroups/fs/cpuset.go
|
|
index 379407e..22b9011 100644
|
|
--- a/libcontainer/cgroups/fs/cpuset.go
|
|
+++ b/libcontainer/cgroups/fs/cpuset.go
|
|
@@ -146,7 +146,9 @@ func (s *CpusetGroup) setCpuset(path, cpuset string) error {
|
|
func (s *CpusetGroup) Set(path string, r *configs.Resources) error {
|
|
var ret error
|
|
if r.CpusetCpus != "" {
|
|
- return s.setCpuset(path, r.CpusetCpus)
|
|
+ if err := s.setCpuset(path, r.CpusetCpus); err != nil {
|
|
+ return err
|
|
+ }
|
|
}
|
|
if r.CpusetMems != "" {
|
|
if err := cgroups.WriteFile(path, "cpuset.mems", r.CpusetMems); err != nil {
|
|
--
|
|
2.33.0
|
|
|