summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2012-06-29 01:50:31 +0200
committerMichal Schmidt <mschmidt@redhat.com>2012-06-29 02:10:41 +0200
commit8eba616fc09b854d13de5dacc5b31b1009c4e8d4 (patch)
treeed04bc9cf427cf346afc3f473a97df247296e4f2 /src/core
parent1a4ac875003b49132c55a0ef36cd6ae2a15d3ac2 (diff)
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
Diffstat (limited to 'src/core')
-rw-r--r--src/core/mount.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/core/mount.c b/src/core/mount.c
index 5364b5dd7c..3d513a051e 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -618,7 +618,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;
@@ -1436,6 +1440,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)) ||