libct/cgroups: fix m.paths map access
This fixes a few cases of accessing m.paths map directly without holding
the mutex lock.
Fixes: 9087f2e82
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
parent
a77d7b1d0f
commit
dd2426d067
|
@ -393,5 +393,5 @@ func (m *manager) GetFreezerState() (configs.FreezerState, error) {
|
|||
}
|
||||
|
||||
func (m *manager) Exists() bool {
|
||||
return cgroups.PathExists(m.paths["devices"])
|
||||
return cgroups.PathExists(m.Path("devices"))
|
||||
}
|
||||
|
|
|
@ -112,6 +112,8 @@ func (m *legacyManager) Apply(pid int) error {
|
|||
properties []systemdDbus.Property
|
||||
)
|
||||
|
||||
m.mu.Lock()
|
||||
defer m.mu.Unlock()
|
||||
if c.Paths != nil {
|
||||
paths := make(map[string]string)
|
||||
for name, path := range c.Paths {
|
||||
|
@ -465,5 +467,5 @@ func (m *legacyManager) GetFreezerState() (configs.FreezerState, error) {
|
|||
}
|
||||
|
||||
func (m *legacyManager) Exists() bool {
|
||||
return cgroups.PathExists(m.paths["devices"])
|
||||
return cgroups.PathExists(m.Path("devices"))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue