To keep autofs behavior consistent blockd should request both: mounting
and unmounting when needed. It's important as autofs-related actions may
require slightly different handling.
Without this patch:
1) autofs mounts were handled using TYPE_AUTOFS
2) autofs unmounts were handled using TYPE_HOTPLUG
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
static void
device_free(struct device *device)
{
- if (device->autofs && device->target)
+ char *mp;
+
+ if (!device->autofs)
+ return;
+
+ if (device->target)
unlink(device->target);
+
+ mp = _find_mount_point(device->name);
+ if (mp) {
+ block("autofs", "remove", device->name);
+ free(mp);
+ }
}
static void