summaryrefslogtreecommitdiff
path: root/src/core/unit-serialize.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-05-15 06:31:17 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-08-05 01:35:38 +0900
commit49267b1b147047c294e882b7ae741f8732d36d05 (patch)
tree1a89d5e10475b43086627159be3f63219bcf4982 /src/core/unit-serialize.c
parent0fe06168b319064a84fca05109ac3eaaeea499c2 (diff)
downloadsystemd-49267b1b147047c294e882b7ae741f8732d36d05.tar.gz
core/mount: make device deps from /proc/self/mountinfo and .mount unit file exclusive
Before this commit, when a .mount unit file is loaded, the device dependencies from the unit file are automatically added. If a device that is different from which specified in .mount unit file is mounted on the path, then the device dependencies about the device are also added. Hence, the unit has device dependencies about two (or more) different devices. Hence, if one of the devices are unplugged, even if another one is mounted on the path, then the path is unmounted. This commit makes device dependencies from two different sources exclusive, and always regenerate the dependencies when one of the information is updated. Fixes #19983 and #23552.
Diffstat (limited to 'src/core/unit-serialize.c')
-rw-r--r--src/core/unit-serialize.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/core/unit-serialize.c b/src/core/unit-serialize.c
index 3897bdee7c..797bf6c5ce 100644
--- a/src/core/unit-serialize.c
+++ b/src/core/unit-serialize.c
@@ -592,6 +592,7 @@ static void print_unit_dependency_mask(FILE *f, const char *kind, UnitDependency
{ UNIT_DEPENDENCY_PATH, "path" },
{ UNIT_DEPENDENCY_MOUNTINFO_IMPLICIT, "mountinfo-implicit" },
{ UNIT_DEPENDENCY_MOUNTINFO_DEFAULT, "mountinfo-default" },
+ { UNIT_DEPENDENCY_MOUNTINFO_OR_FILE, "mountinfo-or-file" },
{ UNIT_DEPENDENCY_PROC_SWAP, "proc-swap" },
{ UNIT_DEPENDENCY_SLICE_PROPERTY, "slice-property" },
};