summaryrefslogtreecommitdiff
path: root/src/mount.c
diff options
context:
space:
mode:
authorAndrey Borzenkov <arvidjaar@gmail.com>2011-03-18 19:12:58 +0300
committerAndrey Borzenkov <arvidjaar@gmail.com>2011-03-18 19:12:58 +0300
commit0c380104cfc52b69ab39737722e8e91fbad6c676 (patch)
tree7920a94b9114dd564f143dbde1e5acdd17f72dd1 /src/mount.c
parent9700edb4e836f95815ee3237e5bc8d224b5014d7 (diff)
mount: pull in quota services from local mountpoints with usr/grpquota options
Diffstat (limited to 'src/mount.c')
-rw-r--r--src/mount.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/mount.c b/src/mount.c
index 39525b6650..99867172c9 100644
--- a/src/mount.c
+++ b/src/mount.c
@@ -413,9 +413,22 @@ static int mount_add_default_dependencies(Mount *m) {
if (m->meta.manager->running_as == MANAGER_SYSTEM &&
!path_equal(m->where, "/")) {
+ MountParameters *p;
- if ((r = unit_add_dependency_by_name(UNIT(m), UNIT_BEFORE, SPECIAL_QUOTACHECK_SERVICE, NULL, true)) < 0)
- return r;
+ if (m->from_fragment)
+ p = &m->parameters_fragment;
+ else if (m->from_etc_fstab)
+ p = &m->parameters_etc_fstab;
+ else
+ p = NULL;
+
+ if (!p ||
+ (!mount_test_option(p->options, "_netdev") &&
+ !(p->fstype && fstype_is_network(p->fstype)) &&
+ (mount_test_option(p->options, "usrquota") || mount_test_option(p->options, "grpquota"))))
+ 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)
+ return r;
if ((r = unit_add_two_dependencies_by_name(UNIT(m), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_UMOUNT_TARGET, NULL, true)) < 0)
return r;