]> git.ipfire.org Git - thirdparty/systemd.git/commit
cgroup: Allow empty assignments of Memory{Low,Min}= 16058/head
authorMichal Koutný <mkoutny@suse.com>
Tue, 4 Feb 2020 15:58:36 +0000 (16:58 +0100)
committerMichal Koutný <mkoutny@suse.com>
Tue, 2 Jun 2020 16:59:47 +0000 (18:59 +0200)
commit53aa85af24cda4470b6750f88e181b775385e228
treebfa5106a4b2453a4843486187ded51ea0cd09717
parentdb2b8d2e2895010f3443a589c9c1f1dfb25256a6
cgroup: Allow empty assignments of Memory{Low,Min}=

Currently, an empty assignment of Memory{Low,Min}= directives would be
interpretted as setting it to global default, i.e. zero. However, if we
set a runtime protection value on a unit that inherits parent's
DefaultMemory{Low,Min}=, it is not possible to revert it back to the
state where the DefaultMemory{Low,Min}= is propagated from parent
slice(s).

This patch changes the semantics of the empty assignments to explicitly
nullify any value set by the user previously. Since DBus API uses
uint64_t where 0 is a valid configuration, the patch modifies DBus API
by exploiting the variant type of property value to pass the NULL value.
src/core/dbus-cgroup.c
src/core/load-fragment.c
src/shared/bus-unit-util.c