* @param controller The controller whose values are being updated
*/
STATIC int cgroup_set_values_recursive(const char * const base,
- const struct cgroup_controller * const controller)
+ const struct cgroup_controller * const controller,
+ bool ignore_non_dirty_failures)
{
char *path = NULL;
int error = 0, ret, j;
free(path);
path = NULL;
+ if (error && ignore_non_dirty_failures &&
+ !controller->values[j]->dirty) {
+ /* We failed to set this value, but it wasn't
+ * marked as dirty, so ignore the failure.
+ */
+ error = 0;
+ continue;
+ }
+
if (error)
goto err;
continue;
error = cgroup_set_values_recursive(base,
- cgroup->controller[i]);
+ cgroup->controller[i], true);
if (error)
goto err;
}
goto err;
error = cgroup_set_values_recursive(base,
- cgroup->controller[k]);
+ cgroup->controller[k], false);
if (error)
goto err;
int cgroup_process_v2_mnt(struct mntent *ent, int *mnt_tbl_idx);
int cgroup_set_values_recursive(const char * const base,
- const struct cgroup_controller * const controller);
+ const struct cgroup_controller * const controller,
+ bool ignore_non_dirty_failures);
int cgroup_chown_chmod_tasks(const char * const cg_path,
uid_t uid, gid_t gid, mode_t fperm);