chiark / gitweb /
core/mount: add dependencies to dynamically mounted mounts too
authorMartin Pitt <martin.pitt@ubuntu.com>
Wed, 28 Jan 2015 12:53:25 +0000 (13:53 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 28 Jan 2015 16:02:28 +0000 (17:02 +0100)
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!

src/core/mount.c

index 6bd6914509f8b290c82a10799739a8741988cf6b..a0b5fda9cb3b6b6261ded3f84ecba89d351b7e24 100644 (file)
@@ -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;