summaryrefslogtreecommitdiff
path: root/src/core/mount.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-05-10 16:44:29 +0200
committerLennart Poettering <lennart@poettering.net>2016-05-10 16:44:29 +0200
commit4b273d46bb939d03757fdf1a932d3811633e0cdf (patch)
tree201621f2bb5c3e96a0ba916046dc210272754135 /src/core/mount.c
parent773ebc0c32cb0d176c0a0bdf633b0891947558d7 (diff)
parentdff4bf93d449b9d9086123521f83d68e98cecd09 (diff)
Merge pull request #3220 from keszybz/install-fixes
Fix "preset-all" with dangling symlinks and install-section hint emitted too eagerly
Diffstat (limited to 'src/core/mount.c')
-rw-r--r--src/core/mount.c37
1 files changed, 16 insertions, 21 deletions
diff --git a/src/core/mount.c b/src/core/mount.c
index 5a8c26b9e1..665a60bb55 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -121,6 +121,20 @@ static bool mount_is_automount(const MountParameters *p) {
"x-systemd.automount\0");
}
+static bool mount_state_active(MountState state) {
+ return IN_SET(state,
+ MOUNT_MOUNTING,
+ MOUNT_MOUNTING_DONE,
+ MOUNT_REMOUNTING,
+ MOUNT_UNMOUNTING,
+ MOUNT_MOUNTING_SIGTERM,
+ MOUNT_MOUNTING_SIGKILL,
+ MOUNT_UNMOUNTING_SIGTERM,
+ MOUNT_UNMOUNTING_SIGKILL,
+ MOUNT_REMOUNTING_SIGTERM,
+ MOUNT_REMOUNTING_SIGKILL);
+}
+
static bool needs_quota(const MountParameters *p) {
assert(p);
@@ -591,16 +605,7 @@ static void mount_set_state(Mount *m, MountState state) {
old_state = m->state;
m->state = state;
- if (state != MOUNT_MOUNTING &&
- state != MOUNT_MOUNTING_DONE &&
- state != MOUNT_REMOUNTING &&
- state != MOUNT_UNMOUNTING &&
- state != MOUNT_MOUNTING_SIGTERM &&
- state != MOUNT_MOUNTING_SIGKILL &&
- state != MOUNT_UNMOUNTING_SIGTERM &&
- state != MOUNT_UNMOUNTING_SIGKILL &&
- state != MOUNT_REMOUNTING_SIGTERM &&
- state != MOUNT_REMOUNTING_SIGKILL) {
+ if (!mount_state_active(state)) {
m->timer_event_source = sd_event_source_unref(m->timer_event_source);
mount_unwatch_control_pid(m);
m->control_command = NULL;
@@ -632,17 +637,7 @@ static int mount_coldplug(Unit *u) {
if (m->control_pid > 0 &&
pid_is_unwaited(m->control_pid) &&
- IN_SET(new_state,
- MOUNT_MOUNTING,
- MOUNT_MOUNTING_DONE,
- MOUNT_REMOUNTING,
- MOUNT_UNMOUNTING,
- MOUNT_MOUNTING_SIGTERM,
- MOUNT_MOUNTING_SIGKILL,
- MOUNT_UNMOUNTING_SIGTERM,
- MOUNT_UNMOUNTING_SIGKILL,
- MOUNT_REMOUNTING_SIGTERM,
- MOUNT_REMOUNTING_SIGKILL)) {
+ mount_state_active(new_state)) {
r = unit_watch_pid(UNIT(m), m->control_pid);
if (r < 0)