From c5624e0c05f0f74f3159fc2738abc9a76d8569aa Mon Sep 17 00:00:00 2001 From: hongjinghao Date: Thu, 4 Sep 2025 19:54:26 +0800 Subject: [PATCH] delete a upstream patch to avoid behavioral differences in cgroupv1 delegate (cherry picked from commit 3ec9abe7e94064bcada30304d06f6dc3de59b9ff) --- ...ble-bpf-pseudo-controllers-when-doin.patch | 69 ------------------- systemd.spec | 6 +- 2 files changed, 4 insertions(+), 71 deletions(-) delete mode 100644 backport-cgroup-don-t-enable-bpf-pseudo-controllers-when-doin.patch diff --git a/backport-cgroup-don-t-enable-bpf-pseudo-controllers-when-doin.patch b/backport-cgroup-don-t-enable-bpf-pseudo-controllers-when-doin.patch deleted file mode 100644 index 70571da..0000000 --- a/backport-cgroup-don-t-enable-bpf-pseudo-controllers-when-doin.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 70f0b7929ed460293176b0490439859fd56f8567 Mon Sep 17 00:00:00 2001 -From: Lennart Poettering -Date: Wed, 24 Jan 2024 22:40:04 +0100 -Subject: [PATCH 0277/1160] cgroup: don't enable bpf pseudo-controllers when - doing a wildcard delegation - -We can only delegate actual controllers, not the BPF pseudo-controllers -we defined as there's imply no concept for that. Hence, when users set -Delegate=yes to do a wildcard delegation, only delegate the regular -controllers. - -This means that we won't bother with BPF stuff for such units where it's -entirelly unnecessary. - -(cherry picked from commit 677e6c14b199c1fa637b7c4c8cae39c31213a79d) ---- - src/basic/cgroup-util.h | 5 ++++- - src/core/dbus-cgroup.c | 2 +- - src/core/load-fragment.c | 2 +- - 3 files changed, 6 insertions(+), 3 deletions(-) - -diff --git a/src/basic/cgroup-util.h b/src/basic/cgroup-util.h -index 6ab14c753d..d06eb6daee 100644 ---- a/src/basic/cgroup-util.h -+++ b/src/basic/cgroup-util.h -@@ -67,10 +67,13 @@ typedef enum CGroupMask { - /* All real cgroup v2 controllers */ - CGROUP_MASK_V2 = CGROUP_MASK_CPU|CGROUP_MASK_CPUSET|CGROUP_MASK_IO|CGROUP_MASK_MEMORY|CGROUP_MASK_PIDS, - -+ /* All controllers we want to delegate in case of Delegate=yes. Which are prety much the v2 controllers only, as delegation on v1 is not safe, and bpf stuff isn't a real controller */ -+ CGROUP_MASK_DELEGATE = CGROUP_MASK_V2, -+ - /* All cgroup v2 BPF pseudo-controllers */ - CGROUP_MASK_BPF = CGROUP_MASK_BPF_FIREWALL|CGROUP_MASK_BPF_DEVICES|CGROUP_MASK_BPF_FOREIGN|CGROUP_MASK_BPF_SOCKET_BIND|CGROUP_MASK_BPF_RESTRICT_NETWORK_INTERFACES, - -- _CGROUP_MASK_ALL = CGROUP_CONTROLLER_TO_MASK(_CGROUP_CONTROLLER_MAX) - 1 -+ _CGROUP_MASK_ALL = CGROUP_CONTROLLER_TO_MASK(_CGROUP_CONTROLLER_MAX) - 1, - } CGroupMask; - - static inline CGroupMask CGROUP_MASK_EXTEND_JOINED(CGroupMask mask) { -diff --git a/src/core/dbus-cgroup.c b/src/core/dbus-cgroup.c -index 4237e694c0..8a9570fd21 100644 ---- a/src/core/dbus-cgroup.c -+++ b/src/core/dbus-cgroup.c -@@ -542,7 +542,7 @@ static int bus_cgroup_set_transient_property( - - if (!UNIT_WRITE_FLAGS_NOOP(flags)) { - c->delegate = b; -- c->delegate_controllers = b ? _CGROUP_MASK_ALL : 0; -+ c->delegate_controllers = b ? CGROUP_MASK_DELEGATE : 0; - - unit_write_settingf(u, flags, name, "Delegate=%s", yes_no(b)); - } -diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c -index f442bd8203..0baf08ecae 100644 ---- a/src/core/load-fragment.c -+++ b/src/core/load-fragment.c -@@ -4034,7 +4034,7 @@ int config_parse_delegate( - - } else if (r > 0) { - c->delegate = true; -- c->delegate_controllers = _CGROUP_MASK_ALL; -+ c->delegate_controllers = CGROUP_MASK_DELEGATE; - } else { - c->delegate = false; - c->delegate_controllers = 0; --- -2.33.0 - diff --git a/systemd.spec b/systemd.spec index 715de4d..fe7ceba 100644 --- a/systemd.spec +++ b/systemd.spec @@ -25,7 +25,7 @@ Name: systemd Url: https://systemd.io/ Version: 255 -Release: 47 +Release: 48 License: MIT and LGPLv2+ and GPLv2+ Summary: System and Service Manager @@ -278,7 +278,6 @@ Patch6224: backport-user-util-validate-the-right-field.patch Patch6225: backport-bootctl-return-earlier-with-print-esp-path.patch Patch6226: backport-test-execute-skip-tests-that-are-broken-without-unpr.patch Patch6227: backport-repart-don-t-try-to-determine-sector-size-from-a-dis.patch -Patch6228: backport-cgroup-don-t-enable-bpf-pseudo-controllers-when-doin.patch Patch6229: backport-sd-bus-fix-exiting-event-loop-when-sd_bus_set_exit_o.patch Patch6230: backport-test-set-ex-separately.patch Patch6231: backport-test-fix-the-container-ID-check.patch @@ -2494,6 +2493,9 @@ fi %{_unitdir}/veritysetup.target %changelog +* Thu Sep 04 2025 hongjinghao - 255-48 +- delete a upstream patch to avoid behavioral differences in cgroupv1 delegate + * Thu Sep 04 2025 hongjinghao - 255-47 - sync patches from upstream systemd-stable v255.18 -- Gitee