]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mount: always use UNIT_DEPENDENCY_FILE in mount_add_quota_dependencies()
authorFranck Bui <fbui@suse.com>
Wed, 5 Oct 2022 08:26:59 +0000 (10:26 +0200)
committerFranck Bui <fbui@suse.com>
Wed, 5 Oct 2022 09:24:10 +0000 (11:24 +0200)
The quota options have always been read from the unit file and ignored if only
present in /proc/self/mountinfo. IOW the quota services are not (automagically)
pulled in for mounts initiated by the user running mount(8).

src/core/mount.c

index fba7c4cac301e1a64b5c16f2d07626cf725c1d37..f971519dc6cb3051773e670165662000f437c92d 100644 (file)
@@ -421,7 +421,6 @@ static int mount_add_device_dependencies(Mount *m) {
 }
 
 static int mount_add_quota_dependencies(Mount *m) {
-        UnitDependencyMask mask;
         MountParameters *p;
         int r;
 
@@ -437,13 +436,13 @@ static int mount_add_quota_dependencies(Mount *m) {
         if (!mount_needs_quota(p))
                 return 0;
 
-        mask = m->from_fragment ? UNIT_DEPENDENCY_FILE : UNIT_DEPENDENCY_MOUNTINFO_IMPLICIT;
-
-        r = unit_add_two_dependencies_by_name(UNIT(m), UNIT_BEFORE, UNIT_WANTS, SPECIAL_QUOTACHECK_SERVICE, true, mask);
+        r = unit_add_two_dependencies_by_name(UNIT(m), UNIT_BEFORE, UNIT_WANTS, SPECIAL_QUOTACHECK_SERVICE,
+                                              /* add_reference= */ true, UNIT_DEPENDENCY_FILE);
         if (r < 0)
                 return r;
 
-        r = unit_add_two_dependencies_by_name(UNIT(m), UNIT_BEFORE, UNIT_WANTS, SPECIAL_QUOTAON_SERVICE, true, mask);
+        r = unit_add_two_dependencies_by_name(UNIT(m), UNIT_BEFORE, UNIT_WANTS, SPECIAL_QUOTAON_SERVICE,
+                                              /* add_reference= */true, UNIT_DEPENDENCY_FILE);
         if (r < 0)
                 return r;