hal doesn't recognize mounting of devices
Jon Nettleton
jon.nettleton at gmail.com
Mon Oct 24 15:41:58 PDT 2005
On Tue, 2005-10-25 at 00:02 +0200, Danny Kukawka wrote:
> On Monday 24 October 2005 16:54, David Zeuthen wrote:
> > On Mon, 2005-10-24 at 13:25 +0200, Danny Kukawka wrote:
> > > I never seen this or get a bugreport for SUSE, but IMO this is a kernel
> > > bug. The kernel should update /proc/mounts before emit the netlink
> > > message. How long is the delay between the event and change in
> > > /proc/mounts?
> > >
> > > Btw. We maybe could workaround this with add a short delay befor
> > > open /proc/mounts (but IMO the kernel need a fix.)
> >
> > We could and should do this in the interim. Are the kernel duders aware
> > of this issue?
>
> I don't know. But why this never happen on SUSE ? Maybe problems with
> preemption or something other? Btw. somebody (with this problem) should post
> this on linux-kernel mailinglist and/or at the bugzilla of gentoo (and other
> effected distributions).
>
> I take a look at the problem in HAL. I would propose to implement this
> behavior: if mount not found in /proc/mounts retry 0.5 or 1.0 second later
> again and emit a error/warning message. If fails again, discard event.
>
> I post a patch as soon as possible.
>
> Cheers,
>
> Danny
I have already found this lone post to the kernel about the problem,
http://lkml.org/lkml/2005/9/14/138 . I have done some of my own testing
and basically come to the conclusion, this is less likely to happen when
not using preemption, however it can be triggered. The ridiculously
simple patch I am using right now which seems to work fine is this.
--- hald/linux2/blockdev.c.orig 2005-10-24 18:13:49.000000000 -0400
+++ hald/linux2/blockdev.c 2005-10-24 15:50:24.000000000 -0400
@@ -178,6 +178,8 @@
HAL_INFO (("Update mount point for %s (device_file %s)", d->udi,
device_file));
+ usleep (1000 * 1000 * 3 / 10);
+
snprintf (buf, sizeof (buf), "%s/mounts", get_hal_proc_path ());
if ((f = setmntent (buf, "r")) == NULL) {
HAL_ERROR (("Could not open /proc/mounts"));
-Jon
> _______________________________________________
> hal mailing list
> hal at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/hal
More information about the hal
mailing list