libct/cgroups/fs: access m.paths under lock
1. Prevent theoretical "concurrent map access" error to m.paths. 2. There is no need to call m.Paths -- we can access m.paths directly. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
parent
51e1a0842d
commit
1d143562d2
|
@ -247,9 +247,10 @@ func (m *manager) Set(container *configs.Config) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
paths := m.GetPaths()
|
||||
m.mu.Lock()
|
||||
defer m.mu.Unlock()
|
||||
for _, sys := range m.getSubsystems() {
|
||||
path := paths[sys.Name()]
|
||||
path := m.paths[sys.Name()]
|
||||
if err := sys.Set(path, container.Cgroups); err != nil {
|
||||
if m.rootless && sys.Name() == "devices" {
|
||||
continue
|
||||
|
|
Loading…
Reference in New Issue