Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 158531 - sys-fs/udev-103 network device renaming fails occasionally
Summary: sys-fs/udev-103 network device renaming fails occasionally
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: udev maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-19 04:13 UTC by Gerte Hoogewerf
Modified: 2007-01-24 21:10 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gerte Hoogewerf 2006-12-19 04:13:51 UTC
First of all I'ld like to thank anyone working on Udev 103. The idea of getting rid of bash scripts for hot- and coldplugging is great and the speedup is really great.

I have a problem however with my current setup. Udev tries to give NIC's the same name every time you boot your system. That's a great idea, but sometimes the renaming of interfaces needed to accomplish this fails for some reason. The result is, that the "Letting udev process Events" step takes very long and after that (either finishing or timing out) I have a network interface called "ethX_rename".

The problem is very hard to reproduce, say it happens once per 20 reboots. The result is that I have no networking as my rc scrips expect me to have a "eth0" interface, where I have a "eth1_rename" instead. 

So, the automatically generated file /etc/udev/rules.d/70-persistent-net.rules is causing troubles for me I guess. I'm pretty sure this is a bug in Udev 103. I'm not sure If I can trigger this bug with any kind of NIC, but this certainly looks like a nasty race condition which happens on at least of of my systems. 

Thank you,
Gerte
Comment 1 Gerte Hoogewerf 2006-12-20 03:41:33 UTC
I have found something that in my opinion is incorrect and perhaps causing some problems.

In udev_device.c, function rename_netif we enter a busy wait loop. If you take a close look to the way we can leave this loop there are two ways:
* With an errno != EEXIST
* When loop == 0

The first one should really never happen. The second should happen only if a network interface name does not come available during our polling, so only when we want to timeout the polling. Try to imagine what happens if the ioctl succeeds.... We just re-enter the loop and now something will go wrong.

Feel free to use this patch to correct it:
http://gerte.nietbelangrijk.nl/udev-103-busywait.txt

I think this is enough to kill the bug. But I'll be testing some more.
Comment 2 Gerte Hoogewerf 2006-12-29 01:53:21 UTC
I've tested udev with my patch. I have no issues anymore. What about inclusion, has anyone looked at it?
Comment 3 Matthias Schwarzott gentoo-dev 2007-01-23 14:07:02 UTC
For me the problem does not occur, renaming network interfaces works.
This patch does no harm to me, after applying it, still everything works.
Comment 4 Matthias Schwarzott gentoo-dev 2007-01-23 16:14:46 UTC
forwarded to hotplug/udev-Mailinglist.
Comment 5 Matthias Schwarzott gentoo-dev 2007-01-24 17:13:47 UTC
Added patch to udev-104-r2 ebuild.
Patch also got applied upstream.
Comment 6 Gerte Hoogewerf 2007-01-24 21:10:47 UTC
Thnx for forwarding the patch. The new ebuild makes me happy.