mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-09-06 21:51:37 +00:00
mount: fix quota
quotacheck.service and quotaon.service were not pulled in for fstab mounts. Fix it by not clearing the default_dependencies flag. The root filesystem may have quotas too, so don't check for "/" there. No need to have duplicate code for adding dependencies on umount.target. https://bugzilla.redhat.com/show_bug.cgi?id=773431
This commit is contained in:
+11
-18
@@ -357,10 +357,6 @@ static int mount_add_fstab_links(Mount *m) {
|
|||||||
after = SPECIAL_LOCAL_FS_PRE_TARGET;
|
after = SPECIAL_LOCAL_FS_PRE_TARGET;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!path_equal(m->where, "/"))
|
|
||||||
if ((r = unit_add_two_dependencies_by_name(UNIT(m), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_UMOUNT_TARGET, NULL, true)) < 0)
|
|
||||||
return r;
|
|
||||||
|
|
||||||
if ((r = manager_load_unit(m->meta.manager, target, NULL, NULL, &tu)) < 0)
|
if ((r = manager_load_unit(m->meta.manager, target, NULL, NULL, &tu)) < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
@@ -461,25 +457,24 @@ static int mount_add_device_links(Mount *m) {
|
|||||||
|
|
||||||
static int mount_add_default_dependencies(Mount *m) {
|
static int mount_add_default_dependencies(Mount *m) {
|
||||||
int r;
|
int r;
|
||||||
|
MountParameters *p;
|
||||||
|
|
||||||
assert(m);
|
assert(m);
|
||||||
|
|
||||||
if (m->meta.manager->running_as == MANAGER_SYSTEM &&
|
if (m->meta.manager->running_as != MANAGER_SYSTEM)
|
||||||
!path_equal(m->where, "/")) {
|
return 0;
|
||||||
MountParameters *p;
|
|
||||||
|
|
||||||
p = get_mount_parameters_configured(m);
|
p = get_mount_parameters_configured(m);
|
||||||
|
if (p && needs_quota(p)) {
|
||||||
if (p && needs_quota(p)) {
|
if ((r = unit_add_two_dependencies_by_name(UNIT(m), UNIT_BEFORE, UNIT_WANTS, SPECIAL_QUOTACHECK_SERVICE, NULL, true)) < 0 ||
|
||||||
if ((r = unit_add_two_dependencies_by_name(UNIT(m), UNIT_BEFORE, UNIT_WANTS, SPECIAL_QUOTACHECK_SERVICE, NULL, true)) < 0 ||
|
(r = unit_add_two_dependencies_by_name(UNIT(m), UNIT_BEFORE, UNIT_WANTS, SPECIAL_QUOTAON_SERVICE, NULL, true)) < 0)
|
||||||
(r = unit_add_two_dependencies_by_name(UNIT(m), UNIT_BEFORE, UNIT_WANTS, SPECIAL_QUOTAON_SERVICE, NULL, true)) < 0)
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((r = unit_add_two_dependencies_by_name(UNIT(m), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_UMOUNT_TARGET, NULL, true)) < 0)
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!path_equal(m->where, "/"))
|
||||||
|
if ((r = unit_add_two_dependencies_by_name(UNIT(m), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_UMOUNT_TARGET, NULL, true)) < 0)
|
||||||
|
return r;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -588,8 +583,6 @@ static int mount_load(Unit *u) {
|
|||||||
|
|
||||||
if (m->meta.fragment_path)
|
if (m->meta.fragment_path)
|
||||||
m->from_fragment = true;
|
m->from_fragment = true;
|
||||||
else if (m->from_etc_fstab)
|
|
||||||
m->meta.default_dependencies = false;
|
|
||||||
|
|
||||||
if (!m->where)
|
if (!m->where)
|
||||||
if (!(m->where = unit_name_to_path(u->meta.id)))
|
if (!(m->where = unit_name_to_path(u->meta.id)))
|
||||||
|
|||||||
Reference in New Issue
Block a user