VolumeUnmountForced symlink problem

Rohan McGovern rohan.pm at gmail.com
Wed Apr 27 15:52:46 PDT 2005


On Thu, 28 Apr 2005 07:43, David Zeuthen wrote:
> On Tue, 2005-04-26 at 15:25 +1000, Rohan McGovern wrote:
> > Hi all,
...
> > Surely the behaviour should be consistent for both symlinked and real
> > device node mounts?
>
> Yeah, it seems odd that the kernel does this. I have no idea why though,
> sorry. All that hal does is a 'umount -l /dev/hdc', can you reproduce
> this without hal in the picture?
>
Without HAL, the disc must always be unmounted manually...

I guess the issue is or may be that HAL calls umount on /dev/hdc, and /dev/hdc 
will not be in /etc/mtab or /proc/mounts if the drive was mounted with a 
symlink like /dev/cdrom.  So maybe it would make more sense to call umount
with the mount point, which will always be present?  Looking at the code, it
seems like the change should be as simple as the following:

diff -ru hal.old/hald/linux2/blockdev.c hal/hald/linux2/blockdev.c
--- hal.old/hald/linux2/blockdev.c      2005-04-28 08:48:03.000000000 +1000
+++ hal/hald/linux2/blockdev.c  2005-04-28 08:49:14.000000000 +1000
@@ -971,14 +971,14 @@
                }
        }

-       umount_argv[2] = device_file;
+       umount_argv[2] = device_mount_point;

        if (hal_device_has_property (d, "block.is_volume") &&
            hal_device_property_get_bool (d, "block.is_volume") &&
            hal_device_property_get_bool (d, "volume.is_mounted") &&
            device_mount_point != NULL &&
            strlen (device_mount_point) > 0) {
-               HAL_INFO (("attempting /bin/umount -l %s", device_file));
+               HAL_INFO (("attempting /bin/umount -l %s", device_mount_point));

                /* TODO: this is a bit dangerous; rather spawn async and do some timout on it */
_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list