dcavalca / rpms / systemd

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