Skip to content

Commit

Permalink
cgroup: always enable controller
Browse files Browse the repository at this point in the history
even if the fast path was taken and the cgroup was already joined, we
still need to make sure all the controllers are enabled.

Closes: #1083

Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe committed Nov 29, 2022
1 parent 258c237 commit 3880f04
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/libcrun/cgroup-cgroupfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,6 @@ libcrun_cgroup_enter_cgroupfs (struct libcrun_cgroup_args *args, struct libcrun_
pid_t pid = args->pid;
int cgroup_mode;

/* The cgroup was already joined, nothing more left to do. */
if (args->joined)
return 0;

cgroup_mode = libcrun_get_cgroup_mode (err);
if (UNLIKELY (cgroup_mode < 0))
return cgroup_mode;
Expand All @@ -112,6 +108,10 @@ libcrun_cgroup_enter_cgroupfs (struct libcrun_cgroup_args *args, struct libcrun_
return ret;
}

/* The cgroup was already joined, nothing more left to do. */
if (args->joined)
return 0;

return enter_cgroup (cgroup_mode, pid, 0, out->path, true, err);
}

Expand Down

0 comments on commit 3880f04

Please sign in to comment.