]> git.ipfire.org Git - thirdparty/systemd.git/commit
cgroup: Eager realization in unit_free
authorMichal Koutný <mkoutny@suse.com>
Mon, 1 Jun 2020 15:30:35 +0000 (17:30 +0200)
committerMichal Koutný <mkoutny@suse.com>
Wed, 19 Aug 2020 09:41:53 +0000 (11:41 +0200)
commitfb46fca7e0c484026bbc9e196aee118800186768
treee2d55d2d90197ca5d8dd0acad5d1d42576fe9f2c
parent7b63961415920b30a4e9f6d4c87bda20a1d8ec67
cgroup: Eager realization in unit_free

unit_free(u) realizes direct parent and invalidates members mask of all
ancestors. This isn't sufficient in v1 controller hierarchies since
siblings of the freed unit may have existed only because of the removed
unit.

We cannot be lazy about the siblings because if parent(u) is also
removed, it'd migrate and rmdir cgroups for siblings(u). However,
realized masks of siblings(u) won't reflect this change.

This was a non-issue earlier, because we weren't removing cgroup
directories properly (effectively matching the stale realized mask),
removal failed because of tasks left by missing migration (see previous
commit).

Therefore, ensure realization of all units necessary to clean up after
the free'd unit.

Fixes: #14149
src/core/cgroup.c
src/core/cgroup.h
src/core/unit.c