From: Martin Pitt Date: Wed, 28 Jan 2015 12:53:25 +0000 (+0100) Subject: core/mount: add dependencies to dynamically mounted mounts too X-Git-Tag: v219~240 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=06e97888883e2cc12eb6514e80c7f0014295f59b core/mount: add dependencies to dynamically mounted mounts too Add unit dependencies for dynamic (i. e. not from fstab) mounts. With that, mount units properly bind to their underlying device, and thus get automatically stopped/unmounted when the underlying device goes away. This cleans up stale mounts from unplugged devices. Thanks to Lennart Poettering for pointing out the fix! --- diff --git a/src/core/mount.c b/src/core/mount.c index 6bd691450..a0b5fda9c 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -300,7 +300,7 @@ static int mount_add_device_links(Mount *m) { assert(m); - p = get_mount_parameters_fragment(m); + p = get_mount_parameters(m); if (!p) return 0;