summaryrefslogtreecommitdiff
path: root/src/mount.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-01-21 01:13:09 +0100
committerLennart Poettering <lennart@poettering.net>2011-01-21 01:13:15 +0100
commite0fa621b8b52da4d95bf5918eb998c9166e4bc7c (patch)
tree56b7bc8b13ec692f914c89f72ea45e779007bd05 /src/mount.c
parent76e7bc8dfbb1139254c3819f448246592f17f317 (diff)
automount: fix segfault when shutting down
https://bugs.freedesktop.org/show_bug.cgi?id=32076
Diffstat (limited to 'src/mount.c')
-rw-r--r--src/mount.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mount.c b/src/mount.c
index f978a5467d..aae9d982ae 100644
--- a/src/mount.c
+++ b/src/mount.c
@@ -98,12 +98,21 @@ static void mount_parameters_done(MountParameters *p) {
static void mount_done(Unit *u) {
Mount *m = MOUNT(u);
+ Meta *other;
assert(m);
free(m->where);
m->where = NULL;
+ /* Try to detach us from the automount unit if there is any */
+ LIST_FOREACH(units_per_type, other, m->meta.manager->units_per_type[UNIT_AUTOMOUNT]) {
+ Automount *a = (Automount*) other;
+
+ if (a->mount == m)
+ a->mount = NULL;
+ }
+
mount_parameters_done(&m->parameters_etc_fstab);
mount_parameters_done(&m->parameters_proc_self_mountinfo);
mount_parameters_done(&m->parameters_fragment);