dcavalca / rpms / systemd

Forked from rpms/systemd 4 months ago
Clone
da2bf9
From 1fb992c50f7fc6a5c399e302ba79097d36a0cedf Mon Sep 17 00:00:00 2001
da2bf9
From: Yu Watanabe <watanabe.yu+github@gmail.com>
da2bf9
Date: Sun, 29 Aug 2021 21:20:43 +0900
da2bf9
Subject: [PATCH] core/mount: add implicit unit dependencies even if when mount
da2bf9
 unit is generated from /proc/self/mountinfo
da2bf9
da2bf9
Hopefully fixes #20566.
da2bf9
da2bf9
(cherry picked from commit aebff2e7ce209fc2d75b894a3ae8b80f6f36ec11)
da2bf9
da2bf9
Resolves: #2008825
da2bf9
---
da2bf9
 src/core/mount.c | 6 +++++-
da2bf9
 1 file changed, 5 insertions(+), 1 deletion(-)
da2bf9
da2bf9
diff --git a/src/core/mount.c b/src/core/mount.c
da2bf9
index 73c0531158..9547cb9b29 100644
da2bf9
--- a/src/core/mount.c
da2bf9
+++ b/src/core/mount.c
da2bf9
@@ -1437,6 +1437,7 @@ static int mount_setup_new_unit(
da2bf9
                 MountSetupFlags *flags) {
da2bf9
 
da2bf9
         MountParameters *p;
da2bf9
+        int r;
da2bf9
 
da2bf9
         assert(u);
da2bf9
         assert(flags);
da2bf9
@@ -1458,7 +1459,6 @@ static int mount_setup_new_unit(
da2bf9
 
da2bf9
         if (!mount_is_extrinsic(MOUNT(u))) {
da2bf9
                 const char *target;
da2bf9
-                int r;
da2bf9
 
da2bf9
                 target = mount_is_network(p) ? SPECIAL_REMOTE_FS_TARGET : SPECIAL_LOCAL_FS_TARGET;
da2bf9
                 r = unit_add_dependency_by_name(u, UNIT_BEFORE, target, NULL, true, UNIT_DEPENDENCY_MOUNTINFO_IMPLICIT);
da2bf9
@@ -1470,6 +1470,10 @@ static int mount_setup_new_unit(
da2bf9
                         return r;
da2bf9
         }
da2bf9
 
da2bf9
+        r = mount_add_non_exec_dependencies(MOUNT(u));
da2bf9
+        if (r < 0)
da2bf9
+                return r;
da2bf9
+
da2bf9
         unit_add_to_load_queue(u);
da2bf9
         flags->is_mounted = true;
da2bf9
         flags->just_mounted = true;