]> git.ipfire.org Git - thirdparty/systemd.git/commit
cgroup: handle ENODEV on cg_read_pid() gracefully
authorLennart Poettering <lennart@poettering.net>
Wed, 9 Jul 2025 12:28:28 +0000 (14:28 +0200)
committerMike Yuan <me@yhndnzj.com>
Wed, 9 Jul 2025 18:45:59 +0000 (20:45 +0200)
commit726183627bf5aae68d537bfaa3cf8307bbc4d1f0
tree3dd0cfb6d7eb671d6840dce8b111ac1dc0d314d7
parentda412f3be223f9b62f637c62270301d048de62a0
cgroup: handle ENODEV on cg_read_pid() gracefully

The recently added test case TEST-07-PID1.subgroup-kill.sh surfaced a
race: if we enumerate PIDs in a cgroup, and the cgroup is unlinked at
the very same time reading will result in ENODEV. We need to handle that
gracefully. Hence let's do so.

Noticed while looking at:

https://github.com/systemd/systemd/actions/runs/16143084441/job/45554929264?pr=38120
src/basic/cgroup-util.c
src/core/dbus-unit.c
src/shared/cgroup-setup.c
src/shared/cgroup-show.c