summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authormsizanoen1 <msizanoen@qtmlabs.xyz>2023-05-23 13:46:26 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2023-05-23 23:22:41 +0200
commitb458659a1619337fa83353b5f41bae35d7ad4c69 (patch)
treec5551419b24ac9024bdf8fa0b8797bac46d38e36 /src
parentMerge pull request #27755 from keszybz/fix-root-resize-new (diff)
downloadsystemd-b458659a1619337fa83353b5f41bae35d7ad4c69.tar.xz
systemd-b458659a1619337fa83353b5f41bae35d7ad4c69.zip
core: Do not check child freezability when thawing slice
We want thawing operations to still succeed even in the presence of an unfreezable unit type (e.g. mount) appearing under a slice after the slice was frozen. The appearance of such units should never cause the slice thawing operation to fail to prevent potential future repeats of https://github.com/systemd/systemd/issues/25356.
Diffstat (limited to 'src')
-rw-r--r--src/core/slice.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/slice.c b/src/core/slice.c
index eb0ba5e763..a11ec62724 100644
--- a/src/core/slice.c
+++ b/src/core/slice.c
@@ -375,7 +375,7 @@ static int slice_freezer_action(Unit *s, FreezerAction action) {
assert(s);
assert(IN_SET(action, FREEZER_FREEZE, FREEZER_THAW));
- if (!slice_freezer_action_supported_by_children(s)) {
+ if (action == FREEZER_FREEZE && !slice_freezer_action_supported_by_children(s)) {
log_unit_warning(s, "Requested freezer operation is not supported by all children of the slice");
return 0;
}
@@ -386,8 +386,11 @@ static int slice_freezer_action(Unit *s, FreezerAction action) {
if (action == FREEZER_FREEZE)
r = UNIT_VTABLE(member)->freeze(member);
- else
+ else if (UNIT_VTABLE(member)->thaw)
r = UNIT_VTABLE(member)->thaw(member);
+ else
+ /* Thawing is requested but no corresponding method is available, ignore. */
+ r = 0;
if (r < 0)
return r;
}