[patch] some fixes for is_mounted detection

David Zeuthen david at fubar.dk
Sun Jul 4 11:09:23 PDT 2004


On Mon, 2004-06-28 at 22:37 +0200, Sjoerd Simons wrote:
> Hi,
>   

Hey, sorry for the lag,

>   There were two little problems with mount detection, which caused it to be
>   not work properly on my machines.
> 

Can you be more specific here?

>   First in read_etc_fstab,

You mean read_etc_mtab here.

>  the number of num_mount_points is reset at the start
>   of the function, while it could still decide not to reread the mtab. Causing
>   the mount_points array to be emptied every time something in /etc changed..
> 

But we don't do anything if we can't read the file or decide not to; the
mount_points array is only applicable within the function
etc_mtab_process_all_block_devices() and this indeed return FALSE if
there is nothing to do and we check on this.

>   Second at the end of block_class_pre_process both detect_media and
>   etc_mtab_process_all_block_devices are called, but these only work on devices
>   in the gdl and at that time the device is still in the tdl. So they're
>   basically nops there. To solve this i've adjusted the ClassDeviceHandler
>   stuff to also call the post_merge function. And let the one for block devices
>   call detect_media and etc_mtab_process_all_block_devices..
> 

This is a good point but it seems wrong to use post_merge for this.
Perhaps we should have an added_to_gdl method on both ClassDeviceHandler
and BusDeviceHandler that is called when it's in the GDL?

Thanks,
David


_______________________________________________
hal mailing list
hal at freedesktop.org
http://freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list