ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
7e7c9f
From 774f040ecc62e9c559269bb13afb1c4d04e1b6ab Mon Sep 17 00:00:00 2001
2f7d91
From: Lennart Poettering <lennart@poettering.net>
2f7d91
Date: Wed, 28 Nov 2018 14:51:04 +0100
2f7d91
Subject: [PATCH] mount: when allocating a Mount object based on
2f7d91
 /proc/self/mountinfo mark it so
2f7d91
2f7d91
Let's set 'from_proc_self_mountinfo' right away, since we know its from
2f7d91
there. This is important so that when the load queue is dispatched (and
2f7d91
thus mount_load() called) this
2f7d91
fact is already known.
2f7d91
2f7d91
(cherry picked from commit 6d7e89b07065b8c49af47aaf1ccc336d017fc3a2)
7e7c9f
Related: #1804757
2f7d91
---
2f7d91
 src/core/mount.c | 7 +++++++
2f7d91
 1 file changed, 7 insertions(+)
2f7d91
2f7d91
diff --git a/src/core/mount.c b/src/core/mount.c
2f7d91
index 126038c27f..34c4b548ad 100644
2f7d91
--- a/src/core/mount.c
2f7d91
+++ b/src/core/mount.c
2f7d91
@@ -1480,6 +1480,13 @@ static int mount_setup_unit(
2f7d91
                         }
2f7d91
                 }
2f7d91
 
2f7d91
+                /* This unit was generated because /proc/self/mountinfo reported it. Remember this, so that by the time we load
2f7d91
+                 * the unit file for it (and thus add in extra deps right after) we know what source to attributes the deps
2f7d91
+                 * to.*/
2f7d91
+                MOUNT(u)->from_proc_self_mountinfo = true;
2f7d91
+
2f7d91
+                /* We have only allocated the stub now, let's enqueue this unit for loading now, so that everything else is
2f7d91
+                 * loaded in now. */
2f7d91
                 unit_add_to_load_queue(u);
2f7d91
                 changed = true;
2f7d91
         } else {