44a72b9
From ed10d8afb4f327536a1fb4c2873c95d3ba457efa Mon Sep 17 00:00:00 2001
27bd1bd
From: =?UTF-8?q?Abd=C3=B3=20Roig-Maranges?= <abdo.roig@gmail.com>
27bd1bd
Date: Mon, 31 Jul 2017 12:32:09 +0200
27bd1bd
Subject: [PATCH] core: Do not fail perpetual mount units without fragment
27bd1bd
 (#6459)
27bd1bd
27bd1bd
mount_load does not require fragment files to be present in order to
27bd1bd
load mount units which are perpetual, or come from /proc/self/mountinfo.
27bd1bd
27bd1bd
mount_verify should do the same, otherwise a synthesized '-.mount' would
27bd1bd
be marked as failed with "No such file or directory", as it is perpetual
27bd1bd
but not marked to come from /proc/self/mountinfo at this point.
27bd1bd
27bd1bd
This happens for the user instance, and I suspect it was the cause of #5375
27bd1bd
for the system instance, without gpt-generator.
27bd1bd
27bd1bd
(cherry picked from commit 1df96fcb31b3bc30c4a983de4734f61ed5a29115)
27bd1bd
---
27bd1bd
 src/core/mount.c | 2 +-
27bd1bd
 1 file changed, 1 insertion(+), 1 deletion(-)
27bd1bd
27bd1bd
diff --git a/src/core/mount.c b/src/core/mount.c
27bd1bd
index 214364d87d..7d9644e305 100644
27bd1bd
--- a/src/core/mount.c
27bd1bd
+++ b/src/core/mount.c
27bd1bd
@@ -503,7 +503,7 @@ static int mount_verify(Mount *m) {
27bd1bd
         if (UNIT(m)->load_state != UNIT_LOADED)
27bd1bd
                 return 0;
27bd1bd
 
27bd1bd
-        if (!m->from_fragment && !m->from_proc_self_mountinfo)
27bd1bd
+        if (!m->from_fragment && !m->from_proc_self_mountinfo && !UNIT(m)->perpetual)
27bd1bd
                 return -ENOENT;
27bd1bd
 
27bd1bd
         r = unit_name_from_path(m->where, ".mount", &e);