From: Franck Bui Date: Mon, 12 Sep 2022 15:50:51 +0000 (+0200) Subject: mount: drop UNIT_DEPENDENCY_MOUNTINFO_IMPLICIT and UNIT_DEPENDENCY_MOUNTINFO_DEFAULT X-Git-Tag: v252-rc2~84^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c77ffc7e0459e2bbc4c0c54ff065aa302ecd62e;p=thirdparty%2Fsystemd.git mount: drop UNIT_DEPENDENCY_MOUNTINFO_IMPLICIT and UNIT_DEPENDENCY_MOUNTINFO_DEFAULT They're not used anymore. --- diff --git a/src/core/mount.c b/src/core/mount.c index f971519dc6c..f9c5c80e35c 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -611,11 +611,10 @@ static int mount_add_non_exec_dependencies(Mount *m) { assert(m); - /* Any dependencies based on /proc/self/mountinfo may be now stale. */ - unit_remove_dependencies(UNIT(m), - UNIT_DEPENDENCY_MOUNTINFO_IMPLICIT | - UNIT_DEPENDENCY_MOUNTINFO_DEFAULT | - UNIT_DEPENDENCY_MOUNTINFO_OR_FILE); + /* We may be called due to this mount appearing in /proc/self/mountinfo, hence we clear all existing + * dependencies that were initialized from the unit file but whose final value really depends on the + * content of /proc/self/mountinfo. Some (such as m->where) might have become stale now. */ + unit_remove_dependencies(UNIT(m), UNIT_DEPENDENCY_MOUNTINFO_OR_FILE); if (!m->where) return 0; diff --git a/src/core/unit-serialize.c b/src/core/unit-serialize.c index 797bf6c5ce9..a8fb4055500 100644 --- a/src/core/unit-serialize.c +++ b/src/core/unit-serialize.c @@ -590,8 +590,6 @@ static void print_unit_dependency_mask(FILE *f, const char *kind, UnitDependency { UNIT_DEPENDENCY_DEFAULT, "default" }, { UNIT_DEPENDENCY_UDEV, "udev" }, { 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" }, diff --git a/src/core/unit.h b/src/core/unit.h index 01cef89525e..06ec7ea7b58 100644 --- a/src/core/unit.h +++ b/src/core/unit.h @@ -79,24 +79,17 @@ typedef enum UnitDependencyMask { /* A dependency created because of some unit's RequiresMountsFor= setting */ UNIT_DEPENDENCY_PATH = 1 << 4, - /* A dependency created because of data read from /proc/self/mountinfo and no other configuration source */ - UNIT_DEPENDENCY_MOUNTINFO_IMPLICIT = 1 << 5, - - /* A dependency created because of data read from /proc/self/mountinfo, but conditionalized by - * DefaultDependencies= and thus also involving configuration from UNIT_DEPENDENCY_FILE sources */ - UNIT_DEPENDENCY_MOUNTINFO_DEFAULT = 1 << 6, - /* A dependency created because of data read from /proc/self/mountinfo, but fallback to unit configuration * sources */ - UNIT_DEPENDENCY_MOUNTINFO_OR_FILE = 1 << 7, + UNIT_DEPENDENCY_MOUNTINFO_OR_FILE = 1 << 5, /* A dependency created because of data read from /proc/swaps and no other configuration source */ - UNIT_DEPENDENCY_PROC_SWAP = 1 << 8, + UNIT_DEPENDENCY_PROC_SWAP = 1 << 6, /* A dependency for units in slices assigned by directly setting Slice= */ - UNIT_DEPENDENCY_SLICE_PROPERTY = 1 << 9, + UNIT_DEPENDENCY_SLICE_PROPERTY = 1 << 7, - _UNIT_DEPENDENCY_MASK_FULL = (1 << 10) - 1, + _UNIT_DEPENDENCY_MASK_FULL = (1 << 8) - 1, } UnitDependencyMask; /* The Unit's dependencies[] hashmaps use this structure as value. It has the same size as a void pointer, and thus can