teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

Blame SOURCES/0853-device-drop-refuse_after.patch

6f381c
From bb9d00035c00b8590c389e66b5d94334bbb7379d Mon Sep 17 00:00:00 2001
6f381c
From: Franck Bui <fbui@suse.com>
6f381c
Date: Mon, 30 Mar 2020 10:49:29 +0200
6f381c
Subject: [PATCH] device: drop refuse_after
6f381c
6f381c
Scheduling devices after a given unit can be useful to start device *jobs* at a
6f381c
specific time in the transaction, see commit 4195077ab4c823c.
6f381c
6f381c
This (hidden) change was introduced by commit eef85c4a3f8054d2.
6f381c
6f381c
(cherry picked from commit b862c25716520d9381d5a841dba0f0c14e9c970a)
6f381c
6f381c
[dtardon: This picks just the minimal relevant change from
6f381c
c80a9a33d04fb4381327a69ce929c94a9f1d0e6c and
6f381c
b862c25716520d9381d5a841dba0f0c14e9c970a]
6f381c
6f381c
Resolves: #2043524
6f381c
---
6f381c
 src/core/unit.c | 5 +++--
6f381c
 1 file changed, 3 insertions(+), 2 deletions(-)
6f381c
6f381c
diff --git a/src/core/unit.c b/src/core/unit.c
6f381c
index dfe0c243ef..9be2a0c326 100644
6f381c
--- a/src/core/unit.c
6f381c
+++ b/src/core/unit.c
6f381c
@@ -2841,8 +2841,9 @@ int unit_add_dependency(
6f381c
                 return 0;
6f381c
         }
6f381c
 
6f381c
-        if ((d == UNIT_BEFORE && other->type == UNIT_DEVICE) ||
6f381c
-            (d == UNIT_AFTER && u->type == UNIT_DEVICE)) {
6f381c
+        /* Note that ordering a device unit after a unit is permitted since it
6f381c
+         * allows to start its job running timeout at a specific time. */
6f381c
+        if (d == UNIT_BEFORE && other->type == UNIT_DEVICE) {
6f381c
                 log_unit_warning(u, "Dependency Before=%s ignored (.device units cannot be delayed)", other->id);
6f381c
                 return 0;
6f381c
         }