]> git.ipfire.org Git - thirdparty/systemd.git/commit
core/cgroup: Apply IODevice*= directives in configured order
authorMichal Koutný <mkoutny@suse.com>
Fri, 13 Sep 2024 17:27:13 +0000 (19:27 +0200)
committerMichal Koutný <mkoutny@suse.com>
Tue, 24 Sep 2024 13:00:41 +0000 (15:00 +0200)
commit0fa0dfa04465651a18107d503f9967f84bd761d1
tree704e60343b31a0013fc5765b0f0c6879d229e86f
parent00f546e25e8e46e5e289e1f2fc2ed3dcc6999223
core/cgroup: Apply IODevice*= directives in configured order

Different device paths may resolve to same device node
(lookup_block_device()), e.g.
        IOReadBandwidthMax=/dev/sda1 18879
        IOReadBandwidthMax=/dev/sda2 18878
where both partitions resolve to /dev/sda and when these values are
applied (they are associated with original paths, i.e. as if applied for
different device) in the order from io_device_limits.

The parsing code prepends, so they end up in reverse order wrt config
file. Switch the direction so that the order of application matches the
order of configuration -- i.e. semantics in all other unit file
directives.

Apply same change to all directives that use per-device lists. (The
question whether partitions should be resolved to base device is
independent.)

And apply the changes equally to DBus properties write handlers.

Fixes #34126
src/core/dbus-cgroup.c
src/core/load-fragment.c