Sophie

Sophie

distrib > Fedora > 17 > i386 > media > updates-src > by-pkgid > ab4b662b9827b6375ffd451bf4abd615 > files > 445

systemd-44-24.fc17.src.rpm

From feaaf545187a13c036d2c6ccdc6300509e3a0520 Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt@redhat.com>
Date: Fri, 29 Jun 2012 01:50:31 +0200
Subject: [PATCH] mount: load only if we there's mountinfo or fragment

Having information from /proc/self/mountinfo is sufficient to consider a
mount unit loaded.

When there's no mountinfo, the loading of the fragment for the mount
unit is not optional. No extra dependency links must be added when the
loading fails.

https://bugzilla.redhat.com/show_bug.cgi?id=835848
(cherry picked from commit 8eba616fc09b854d13de5dacc5b31b1009c4e8d4)
---
 src/core/mount.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/core/mount.c b/src/core/mount.c
index 439dd84..dce7094 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -676,7 +676,11 @@ static int mount_load(Unit *u) {
         assert(u);
         assert(u->load_state == UNIT_STUB);
 
-        r = unit_load_fragment_and_dropin_optional(u);
+        if (m->from_proc_self_mountinfo)
+                r = unit_load_fragment_and_dropin_optional(u);
+        else
+                r = unit_load_fragment_and_dropin(u);
+
         if (r < 0)
                 return r;
 
@@ -1511,6 +1515,14 @@ static int mount_add_one(
         } else {
                 delete = false;
                 free(e);
+
+                if (u->load_state == UNIT_ERROR) {
+                        u->load_state = UNIT_LOADED;
+                        u->load_error = 0;
+                        r = mount_add_extras(MOUNT(u));
+                        if (r < 0)
+                                goto fail;
+                }
         }
 
         if (!(w = strdup(what)) ||