Skip to content

Commit 73a8516

Browse files
cgroupv2: reset lastErr to nil when subtree control is successfully written
As stated originally in the comment, ``the user may face EPERM on parent groups", it should not be an error when writing to grand-parent groups fails but writing to the last one succeeds. Signed-off-by: Miao Wang <[email protected]>
1 parent 2ca92c5 commit 73a8516

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

v2/manager.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,8 @@ func (c *Manager) ToggleControllers(controllers []string, t ControllerToggle) er
272272
// controller is already written.
273273
// So we only return the last error.
274274
lastErr = errors.Wrapf(err, "failed to write subtree controllers %+v to %q", controllers, filePath)
275+
} else {
276+
lastErr = nil
275277
}
276278
}
277279
return lastErr

0 commit comments

Comments
 (0)