X Tutup
Skip to content

Commit 5bb2706

Browse files
authored
Revert "fstab-generator, core/mount: Avoid special fs target before dependency only if nofail is used"
1 parent 594f64f commit 5bb2706

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/core/mount.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,14 @@ static MountParameters* get_mount_parameters(Mount *m) {
8484
return get_mount_parameters_fragment(m);
8585
}
8686

87+
static bool mount_is_automount(const MountParameters *p) {
88+
assert(p);
89+
90+
return fstab_test_option(p->options,
91+
"comment=systemd.automount\0"
92+
"x-systemd.automount\0");
93+
}
94+
8795
static bool mount_is_network(const MountParameters *p) {
8896
assert(p);
8997

@@ -476,7 +484,7 @@ static int mount_add_default_ordering_dependencies(
476484
before = SPECIAL_LOCAL_FS_TARGET;
477485
}
478486

479-
if (!mount_is_nofail(m)) {
487+
if (!mount_is_nofail(m) && !mount_is_automount(p)) {
480488
r = unit_add_dependency_by_name(UNIT(m), UNIT_BEFORE, before, true, mask);
481489
if (r < 0)
482490
return r;

src/fstab-generator/fstab-generator.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,8 @@ static int add_mount(
437437

438438
/* Order the mount unit we generate relative to the post unit, so that DefaultDependencies= on the
439439
* target unit won't affect us. */
440-
if (post && !FLAGS_SET(flags, MOUNT_NOFAIL))
440+
if (post && !FLAGS_SET(flags, MOUNT_AUTOMOUNT) && !FLAGS_SET(flags, MOUNT_NOAUTO) &&
441+
!FLAGS_SET(flags, MOUNT_NOFAIL))
441442
fprintf(f, "Before=%s\n", post);
442443

443444
if (passno != 0) {

0 commit comments

Comments
 (0)
X Tutup