chiark / gitweb /
mount: don't try to initialize extra deps for mount units before initializing their...
[elogind.git] / src / core / mount.c
index 3e40e3fc7b3729fde2fdab4847a0c56b54e08cbf..e1c240e31b0e1ca43b79f13b31cdc061d79cdde2 100644 (file)
@@ -1408,6 +1408,7 @@ static int mount_add_one(
         bool delete;
         char *e, *w = NULL, *o = NULL, *f = NULL;
         MountParameters *p;
+        bool load_extras = false;
 
         assert(m);
         assert(what);
@@ -1461,9 +1462,10 @@ static int mount_add_one(
                 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;
+
+                        /* Load in the extras later on, after we
+                         * finished initialization of the unit */
+                        load_extras = true;
                 }
         }
 
@@ -1494,6 +1496,12 @@ static int mount_add_one(
 
         p->passno = passno;
 
+        if (load_extras) {
+                r = mount_add_extras(MOUNT(u));
+                if (r < 0)
+                        goto fail;
+        }
+
         unit_add_to_dbus_queue(u);
 
         return 0;