Re: [2.6 PATCH/RFC] Firmware loader - fix races and resource dealloocation problems

From: Greg KH
Date: Thu Jan 01 2004 - 15:01:13 EST


On Wed, Dec 31, 2003 at 11:32:44PM +0100, Manuel Estrada Sainz wrote:
>
> Maybe some generic mechanism could be implemented to make the hotplug
> event wait for the files.

No.

> The least intrusive solution, although it doesn't sound quite clean could be:
>
> - Kernel side:
> - sysfs_hotplug_frezze()
> - Creates a dummy file /sys/.hotplug_frozen
> - sysfs_hotplug_thaw()
> - Removes /sys/.hotplug_frozen
> - Userspace:
> - Main hotplug script waits "while [ -f /sys/.hotplug_frozen ]".

Ick. You realize how many hotplug events we spit out already today?
This would be a huge bottleneck.

It's not that tough to just see if the file you are looking is there,
and if not sleep. If after an ammount of time the file still isn't
there, just give up.

Also, not all hotplug scripts care about sysfs files being present :)

thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/