From 4258e36157751ef83191ba4fb80358f1c05e57775d98350f381a6f1835198e2f Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Fri, 25 Sep 2015 06:51:59 +0000 Subject: [PATCH] osc copypac from project:openSUSE:Factory:Staging:J package:systemd revision:2, using expand OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=222 --- systemd-bfo88401.patch | 135 +++++++++++++++++++++++++++++++++++++++++ systemd-mini.changes | 5 ++ systemd-mini.spec | 4 +- systemd.changes | 5 ++ systemd.spec | 4 +- 5 files changed, 151 insertions(+), 2 deletions(-) create mode 100644 systemd-bfo88401.patch diff --git a/systemd-bfo88401.patch b/systemd-bfo88401.patch new file mode 100644 index 00000000..c2733d67 --- /dev/null +++ b/systemd-bfo88401.patch @@ -0,0 +1,135 @@ +From f78f265f405a61387c6c12a879ac0d6b6dc958db Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Fri, 24 Apr 2015 16:04:50 +0200 +Subject: core: always coldplug units that are triggered by other units before + those + +Let's make sure that we don't enqueue triggering jobs for units before +those units are actually fully loaded. + +http://lists.freedesktop.org/archives/systemd-devel/2015-April/031176.html +https://bugs.freedesktop.org/show_bug.cgi?id=88401 + +diff --git a/src/core/unit.c b/src/core/unit.c +index 70a2b57..2b356e2 100644 +--- a/src/core/unit.c ++++ b/src/core/unit.c +@@ -2876,13 +2876,32 @@ int unit_add_node_link(Unit *u, const char *what, bool wants) { + } + + int unit_coldplug(Unit *u) { ++ Unit *other; ++ Iterator i; + int r; + + assert(u); + +- if (UNIT_VTABLE(u)->coldplug) +- if ((r = UNIT_VTABLE(u)->coldplug(u)) < 0) ++ /* Make sure we don't enter a loop, when coldplugging ++ * recursively. */ ++ if (u->coldplugged) ++ return 0; ++ ++ u->coldplugged = true; ++ ++ /* Make sure everything that we might pull in through ++ * triggering is coldplugged before us */ ++ SET_FOREACH(other, u->dependencies[UNIT_TRIGGERS], i) { ++ r = unit_coldplug(other); ++ if (r < 0) + return r; ++ } ++ ++ if (UNIT_VTABLE(u)->coldplug) { ++ r = UNIT_VTABLE(u)->coldplug(u); ++ if (r < 0) ++ return r; ++ } + + if (u->job) { + r = job_coldplug(u->job); +diff --git a/src/core/unit.h b/src/core/unit.h +index be306a0..1a44271 100644 +--- a/src/core/unit.h ++++ b/src/core/unit.h +@@ -104,6 +104,7 @@ struct Unit { + char *fragment_path; /* if loaded from a config file this is the primary path to it */ + char *source_path; /* if converted, the source file */ + char **dropin_paths; ++ + usec_t fragment_mtime; + usec_t source_mtime; + usec_t dropin_mtime; +@@ -233,6 +234,9 @@ struct Unit { + bool cgroup_realized:1; + bool cgroup_members_mask_valid:1; + bool cgroup_subtree_mask_valid:1; ++ ++ /* Did we already invoke unit_coldplug() for this unit? */ ++ bool coldplugged; + }; + + struct UnitStatusMessageFormats { +-- +cgit v0.10.2 + + +From 4370633083dd9453da183c468cf89cc17254ac39 Mon Sep 17 00:00:00 2001 +From: Ivan Shapovalov +Date: Mon, 27 Apr 2015 21:19:02 +0300 +Subject: core: coldplug all units which participate in jobs during + coldplugging + +This is yet another attempt to fix coldplugging order (more especially, +the problem which happens when one creates a job during coldplugging and +it references a not-yet-coldplugged unit). + +Now we forcibly coldplug all units which participate in jobs. This +is a superset of previously implemented handling of the UNIT_TRIGGERS +dependencies, so that handling is removed. + +http://lists.freedesktop.org/archives/systemd-devel/2015-April/031212.html +https://bugs.freedesktop.org/show_bug.cgi?id=88401 (once again) + +diff --git a/src/core/transaction.c b/src/core/transaction.c +index 5974b1e..7b19e2f 100644 +--- a/src/core/transaction.c ++++ b/src/core/transaction.c +@@ -848,6 +848,13 @@ int transaction_add_job_and_dependencies( + assert(type < _JOB_TYPE_MAX_IN_TRANSACTION); + assert(unit); + ++ /* Before adding jobs for this unit, let's ensure that its state has been loaded ++ * This matters when jobs are spawned as part of coldplugging itself (see e. g. path_coldplug()). ++ * This way, we "recursively" coldplug units, ensuring that we do not look at state of ++ * not-yet-coldplugged units. */ ++ if (unit->manager->n_reloading > 0) ++ unit_coldplug(unit); ++ + /* log_debug("Pulling in %s/%s from %s/%s", */ + /* unit->id, job_type_to_string(type), */ + /* by ? by->unit->id : "NA", */ +diff --git a/src/core/unit.c b/src/core/unit.c +index 496db6c..b7ab084 100644 +--- a/src/core/unit.c ++++ b/src/core/unit.c +@@ -2893,14 +2893,6 @@ int unit_coldplug(Unit *u) { + + u->coldplugged = true; + +- /* Make sure everything that we might pull in through +- * triggering is coldplugged before us */ +- SET_FOREACH(other, u->dependencies[UNIT_TRIGGERS], i) { +- r = unit_coldplug(other); +- if (r < 0) +- return r; +- } +- + if (UNIT_VTABLE(u)->coldplug) { + r = UNIT_VTABLE(u)->coldplug(u); + if (r < 0) +-- +cgit v0.10.2 + + diff --git a/systemd-mini.changes b/systemd-mini.changes index a469ea14..21c45c47 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Sep 24 12:47:29 UTC 2015 - dimstar@opensuse.org + +- Add systemd-bfo88401.patch: do not restart services on coldplug. + ------------------------------------------------------------------- Thu Jun 11 14:48:03 UTC 2015 - werner@suse.de diff --git a/systemd-mini.spec b/systemd-mini.spec index 88c4728f..4bf79010 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -1,7 +1,7 @@ # # spec file for package systemd-mini # -# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -256,6 +256,7 @@ Patch521: kbd-model-map.patch Patch522: 0001-core-rework-device-state-logic.patch # PATCH-FIX-SUSE/PATCH-FIX-UPSTREAM Patch523: 0001-Let-some-boolean-survive-a-daemon-reload.patch +Patch524: systemd-bfo88401.patch # UDEV PATCHES # ============ @@ -609,6 +610,7 @@ cp %{SOURCE7} m4/ %patch521 -p1 %patch522 -p1 %patch523 -p1 +%patch524 -p1 # udev patches %patch1001 -p1 diff --git a/systemd.changes b/systemd.changes index a469ea14..21c45c47 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Sep 24 12:47:29 UTC 2015 - dimstar@opensuse.org + +- Add systemd-bfo88401.patch: do not restart services on coldplug. + ------------------------------------------------------------------- Thu Jun 11 14:48:03 UTC 2015 - werner@suse.de diff --git a/systemd.spec b/systemd.spec index 8fbaa905..1827beb2 100644 --- a/systemd.spec +++ b/systemd.spec @@ -1,7 +1,7 @@ # # spec file for package systemd # -# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -251,6 +251,7 @@ Patch521: kbd-model-map.patch Patch522: 0001-core-rework-device-state-logic.patch # PATCH-FIX-SUSE/PATCH-FIX-UPSTREAM Patch523: 0001-Let-some-boolean-survive-a-daemon-reload.patch +Patch524: systemd-bfo88401.patch # UDEV PATCHES # ============ @@ -604,6 +605,7 @@ cp %{SOURCE7} m4/ %patch521 -p1 %patch522 -p1 %patch523 -p1 +%patch524 -p1 # udev patches %patch1001 -p1