mdev race conditions

Denys Vlasenko vda.linux at googlemail.com
Tue Jul 15 22:36:44 UTC 2008


On Tuesday 03 June 2008 16:44, Bernard Blackham wrote:
> Hi,
> 
> When I switched from udev+udevd to mdev, booting was much faster and it 
> shaved a decent amount from the total image size. However, I've recently 
> noticed device nodes sometimes disappearing on boot. The specific 
> scenario is:
> 
> 1. /dev/ttyS1 exists as a device node in the filesystem on boot - prior 
> to the actual device existing, and prior to mdev being called.
> 
> 2. echo /bin/mdev > /proc/sys/kernel/hotplug
> 
> 3. a module is loaded that provides ttyS1
> 
> When this module is loaded, most of the time the existing ttyS1 remains. 
> Sometimes however, it is unlinked from the filesystem and is never seen 
> again (until mdev -s is run, or next boot, maybe).
> 
> I pointed my hotplug to a script to log what mdev was being called as, 
> and found that when the module is loaded, there is actually a remove 
> event emitted followed by an add event. As there is no locking with 
> mdev, sometimes mdev runs the remove after the add and thus the device 
> node goes missing.

Despite my solution of having a seq file is considered "lame",
I decided that it's better than nothing.

I would like to ask mdev users to test attached patch.
You need to create /etc/mdev.seq to activate serializing code.
Patch explains this in more details.
--
vda

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 3.patch
Type: text/x-diff
Size: 3346 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20080716/4ebeca79/attachment.bin 


More information about the busybox mailing list