Skip to content

Commit

Permalink
Revert "cgroup-util: Don't try to open pidfd for kernel threads"
Browse files Browse the repository at this point in the history
The kernel patch was reverted so let's try again to open pidfds
for kernel threads.

This reverts commit ead48ec.

(cherry picked from commit 1ce69e0)
  • Loading branch information
DaanDeMeyer authored and jamacku committed Aug 28, 2024
1 parent 6a8e030 commit dfecbf6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/basic/cgroup-util.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,7 @@ int cg_read_pidref(FILE *f, PidRef *ret, CGroupFlags flags) {
if (pid == 0)
return -EREMOTE;

/* We might read kernel thread pids from cgroup.procs for which we cannot create a pidfd so
* catch those and don't try to create a pidfd for them. */
if (FLAGS_SET(flags, CGROUP_NO_PIDFD) || pid_is_kernel_thread(pid) > 0) {
if (FLAGS_SET(flags, CGROUP_NO_PIDFD)) {
*ret = PIDREF_MAKE_FROM_PID(pid);
return 1;
}
Expand Down

0 comments on commit dfecbf6

Please sign in to comment.