summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-04-29 12:50:29 +0200
committerLennart Poettering <lennart@poettering.net>2016-04-29 12:50:29 +0200
commit365007369b4539ffda378fec7ce2188f11e72982 (patch)
tree9c0b4576af98bb0155e54596d2e3a8cd8cd5d40f /src
parente4196edfbf8edcee8771be5a71b69c95ea63d604 (diff)
parentd3bd0986bb7f3527620359aedf77253b16927ba1 (diff)
Merge pull request #3069 from Werkov/fix-dependencies-for-bind-mounts
Always create dependencies for bind mounts
Diffstat (limited to 'src')
-rw-r--r--src/core/mount.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/core/mount.c b/src/core/mount.c
index 188fb0aa40..cc07873b24 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -86,6 +86,15 @@ static bool mount_is_network(const MountParameters *p) {
return mount_needs_network(p->options, p->fstype);
}
+static bool mount_is_loop(const MountParameters *p) {
+ assert(p);
+
+ if (fstab_test_option(p->options, "loop\0"))
+ return true;
+
+ return false;
+}
+
static bool mount_is_bind(const MountParameters *p) {
assert(p);
@@ -269,12 +278,12 @@ static int mount_add_mount_links(Mount *m) {
}
/* Adds in links to other mount points that might be needed
- * for the source path (if this is a bind mount) to be
+ * for the source path (if this is a bind mount or a loop mount) to be
* available. */
pm = get_mount_parameters_fragment(m);
if (pm && pm->what &&
path_is_absolute(pm->what) &&
- !mount_is_network(pm)) {
+ (mount_is_bind(pm) || mount_is_loop(pm) || !mount_is_network(pm))) {
r = unit_require_mounts_for(UNIT(m), pm->what);
if (r < 0)