From 26919ac110c543291b1ad6fa6f22f56253de704d Mon Sep 17 00:00:00 2001 From: Michal Koutný Date: Tue, 19 Apr 2016 18:44:40 +0200 Subject: Always create dependencies for bind mounts Dependencies were not created for _netdev mountpoints, the reasoning for this is in the commit fc676b00, i.e. to avoid adding dependencies for network mountpoints where What= appears like a path. Thus proposing this semantically more correct condition when dependencies are added for _actual_ bind mounts irrespectively of network flag. Consequently it allows to add _netdev option to bind mounts, which includes them in remote-fs.target, which simplifies configuration. --- src/core/mount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/mount.c b/src/core/mount.c index 632c5c824c..efb4a39eb4 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -274,7 +274,7 @@ static int mount_add_mount_links(Mount *m) { 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_network(pm))) { r = unit_require_mounts_for(UNIT(m), pm->what); if (r < 0) -- cgit v1.2.3-54-g00ecf From d3bd0986bb7f3527620359aedf77253b16927ba1 Mon Sep 17 00:00:00 2001 From: Michal Koutný Date: Mon, 25 Apr 2016 13:25:00 +0200 Subject: Always create dependencies for loop device mounts In case a file is on a networked filesystem, we may tag the fstab record with _netdev option, however, corrrect dependencies will be created for this mount. --- src/core/mount.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/core') diff --git a/src/core/mount.c b/src/core/mount.c index efb4a39eb4..6cfca1a4a9 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_bind(pm) || !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) -- cgit v1.2.3-54-g00ecf