From d54bab90e64f70c1ecf9b0683a98adb8485ed09e Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 28 Nov 2018 12:35:37 +0100 Subject: [PATCH] mount: set up local-fs.target/remote-fs.target deps in mount_add_default_dependencies() too This deps are very similar to the -pre deps, hence establish them at the same place, in particular as they should only be generated if default deps are on. This allows us to later on remove similar code that adds in these deps whenever /proc/self/mountinfo changes. --- src/core/mount.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/core/mount.c b/src/core/mount.c index 134349d6f9..94498bfc31 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -423,10 +423,10 @@ static bool mount_is_extrinsic(Mount *m) { } static int mount_add_default_dependencies(Mount *m) { + const char *after, *before; UnitDependencyMask mask; - int r; MountParameters *p; - const char *after; + int r; assert(m); @@ -468,8 +468,15 @@ static int mount_add_default_dependencies(Mount *m) { return r; after = SPECIAL_REMOTE_FS_PRE_TARGET; - } else + before = SPECIAL_REMOTE_FS_TARGET; + } else { after = SPECIAL_LOCAL_FS_PRE_TARGET; + before = SPECIAL_LOCAL_FS_TARGET; + } + + r = unit_add_dependency_by_name(UNIT(m), UNIT_BEFORE, before, true, mask); + if (r < 0) + return r; r = unit_add_dependency_by_name(UNIT(m), UNIT_AFTER, after, true, mask); if (r < 0)