]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mount: do not update exec deps on mountinfo changes 14040/head
authorLennart Poettering <lennart@poettering.net>
Fri, 15 Nov 2019 13:00:54 +0000 (14:00 +0100)
committerLennart Poettering <lennart@poettering.net>
Sat, 16 Nov 2019 12:53:48 +0000 (13:53 +0100)
Fixes: #13978
src/core/mount.c

index 1d1d2683da41820ef13eb41a52fd62419d212bfc..dfed691c43fe34e98e4cc3df4e27bc6010c82210 100644 (file)
@@ -550,6 +550,32 @@ static int mount_verify(Mount *m) {
         return 0;
 }
 
+static int mount_add_non_exec_dependencies(Mount *m) {
+        int r;
+        assert(m);
+
+        /* Adds in all dependencies directly responsible for ordering the mount, as opposed to dependencies
+         * resulting from the ExecContext and such. */
+
+        r = mount_add_device_dependencies(m);
+        if (r < 0)
+                return r;
+
+        r = mount_add_mount_dependencies(m);
+        if (r < 0)
+                return r;
+
+        r = mount_add_quota_dependencies(m);
+        if (r < 0)
+                return r;
+
+        r = mount_add_default_dependencies(m);
+        if (r < 0)
+                return r;
+
+        return 0;
+}
+
 static int mount_add_extras(Mount *m) {
         Unit *u = UNIT(m);
         int r;
@@ -577,18 +603,6 @@ static int mount_add_extras(Mount *m) {
                         return r;
         }
 
-        r = mount_add_device_dependencies(m);
-        if (r < 0)
-                return r;
-
-        r = mount_add_mount_dependencies(m);
-        if (r < 0)
-                return r;
-
-        r = mount_add_quota_dependencies(m);
-        if (r < 0)
-                return r;
-
         r = unit_patch_contexts(u);
         if (r < 0)
                 return r;
@@ -601,7 +615,7 @@ static int mount_add_extras(Mount *m) {
         if (r < 0)
                 return r;
 
-        r = mount_add_default_dependencies(m);
+        r = mount_add_non_exec_dependencies(m);
         if (r < 0)
                 return r;
 
@@ -1574,7 +1588,7 @@ static int mount_setup_existing_unit(
 
                 unit_remove_dependencies(u, UNIT_DEPENDENCY_MOUNTINFO_IMPLICIT);
 
-                r = mount_add_extras(MOUNT(u));
+                r = mount_add_non_exec_dependencies(MOUNT(u));
                 if (r < 0)
                         return r;
         }