Merge pull request #11373 from tomty89/auto

mount/generators: do not make unit wanted by its device unit
This commit is contained in:
Lennart Poettering 2019-02-15 11:31:55 +01:00 committed by GitHub
commit 7ca9289ca2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 23 deletions

View File

@ -101,20 +101,6 @@ static bool mount_is_bind(const MountParameters *p) {
return false;
}
static bool mount_is_auto(const MountParameters *p) {
assert(p);
return !fstab_test_option(p->options, "noauto\0");
}
static bool mount_is_automount(const MountParameters *p) {
assert(p);
return fstab_test_option(p->options,
"comment=systemd.automount\0"
"x-systemd.automount\0");
}
static bool mount_is_bound_to_device(const Mount *m) {
const MountParameters *p;
@ -338,7 +324,6 @@ static int mount_add_mount_dependencies(Mount *m) {
}
static int mount_add_device_dependencies(Mount *m) {
bool device_wants_mount;
UnitDependencyMask mask;
MountParameters *p;
UnitDependency dep;
@ -368,9 +353,6 @@ static int mount_add_device_dependencies(Mount *m) {
if (path_equal(m->where, "/"))
return 0;
device_wants_mount =
mount_is_auto(p) && !mount_is_automount(p) && MANAGER_IS_SYSTEM(UNIT(m)->manager);
/* Mount units from /proc/self/mountinfo are not bound to devices
* by default since they're subject to races when devices are
* unplugged. But the user can still force this dep with an
@ -381,7 +363,7 @@ static int mount_add_device_dependencies(Mount *m) {
/* We always use 'what' from /proc/self/mountinfo if mounted */
mask = m->from_proc_self_mountinfo ? UNIT_DEPENDENCY_MOUNTINFO_IMPLICIT : UNIT_DEPENDENCY_FILE;
r = unit_add_node_dependency(UNIT(m), p->what, device_wants_mount, dep, mask);
r = unit_add_node_dependency(UNIT(m), p->what, false, dep, mask);
if (r < 0)
return r;

View File

@ -287,10 +287,6 @@ static int create_disk(
return log_error_errno(r, "Failed to write unit file %s: %m", n);
if (!noauto) {
r = generator_add_symlink(arg_dest, d, "wants", n);
if (r < 0)
return r;
r = generator_add_symlink(arg_dest,
netdev ? "remote-cryptsetup.target" : "cryptsetup.target",
nofail ? "wants" : "requires", n);