[Bug 870537] New: systemd-udevd doesn't rename persistent rule correctly
https://bugzilla.novell.com/show_bug.cgi?id=870537 https://bugzilla.novell.com/show_bug.cgi?id=870537#c0 Summary: systemd-udevd doesn't rename persistent rule correctly Classification: openSUSE Product: openSUSE Factory Version: 13.2 Milestone 0 Platform: All OS/Version: openSUSE 13.2 Status: ASSIGNED Severity: Major Priority: P5 - None Component: Basesystem AssignedTo: rmilasan@suse.com ReportedBy: rmilasan@suse.com QAContact: qa-bugs@suse.de CC: werner@suse.com, systemd-maintainers@suse.de Found By: L3 Blocker: --- Created an attachment (id=583905) --> (http://bugzilla.novell.com/attachment.cgi?id=583905) 1006-udev-always-rename-network.patch Since the move to systemd 210, using persistent rules, the network interfaces are not renamed correctly also the rename is not 'showed' correctly. This is due to patch 1006-udev-always-rename-network.patch. Example (done in VirtualBox with 3 network devices): our current predictable names: opensuse-factory:~ # ip l 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether 08:00:27:90:de:7b brd ff:ff:ff:ff:ff:ff 3: enp0s8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether 08:00:27:50:e2:6f brd ff:ff:ff:ff:ff:ff 4: enp0s9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether 08:00:27:b7:44:32 brd ff:ff:ff:ff:ff:ff the persistent rule used: # PCI device 8086:100E (e1000) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:90:de:7b", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1" # PCI device 8086:100E (e1000) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:50:e2:6f", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" # PCI device 8086:100E (e1000) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:b7:44:32", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2" Persistent rule found in /etc/udev/rules.d/70-persistent-net.rules, we update the initramfs image and reboot. The expected outcome would be to see that all the network devices are renamed according to the rule (this doesn't work properly even if net.ifnames=0 is used) First reboot without using net.ifnames=0 opensuse-factory:~ # ip l 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether 08:00:27:90:de:7b brd ff:ff:ff:ff:ff:ff 3: enp0s8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether 08:00:27:50:e2:6f brd ff:ff:ff:ff:ff:ff 4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether 08:00:27:b7:44:32 brd ff:ff:ff:ff:ff:ff Second reboot with net.ifnames=0 opensuse-factory:~ # ip l 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether 08:00:27:90:de:7b brd ff:ff:ff:ff:ff:ff 3: rename3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether 08:00:27:50:e2:6f brd ff:ff:ff:ff:ff:ff 4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether 08:00:27:b7:44:32 brd ff:ff:ff:ff:ff:ff opensuse-factory:~ # dmesg |grep udev [ 0.741814] systemd-udevd[173]: starting version 210 [ 1.934130] systemd-udevd[184]: renamed network interface eth1 to rename3 [ 1.940191] systemd-udevd[185]: renamed network interface eth0 to eth1 [ 2.552434] systemd-udevd[309]: starting version 210 I've reworked the patch which causes this issue and attached it to the bug for reference. This affected both openSUSE and SLE12. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=870537 https://bugzilla.novell.com/show_bug.cgi?id=870537#c1 --- Comment #1 from Robert Milasan <rmilasan@suse.com> 2014-03-27 08:28:01 UTC --- Third reboot with reworked patch and net.ifnames=0 used: opensuse-factory:~ # ip l 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether 08:00:27:90:de:7b brd ff:ff:ff:ff:ff:ff 3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether 08:00:27:50:e2:6f brd ff:ff:ff:ff:ff:ff 4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether 08:00:27:b7:44:32 brd ff:ff:ff:ff:ff:ff opensuse-factory:~ # dmesg |grep udev [ 0.749320] systemd-udevd[173]: starting version 210 [ 1.954136] systemd-udevd[184]: renamed network interface eth1 to rename3 [ 1.958179] systemd-udevd[185]: renamed network interface eth0 to eth1 [ 2.007227] systemd-udevd[184]: renamed network interface rename3 to eth0 [ 2.623058] systemd-udevd[308]: starting version 210 opensuse-factory:~ # cat /proc/cmdline BOOT_IMAGE=/boot/vmlinuz-3.14.0-rc5-1-desktop root=UUID=4be0e30c-17f4-4e47-8126-a0b7c565dc6a elevator=noop apparmor=0 selinux=0 audit=0 resume=/dev/disk/by-uuid/3835bc7f-8b60-4315-a0b4-1cd3839a9532 splash=silent quiet net.ifnames=0 Fifth reboot with reworked patch and without net.ifnames=0: opensuse-factory:~ # ip l 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether 08:00:27:90:de:7b brd ff:ff:ff:ff:ff:ff 3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether 08:00:27:50:e2:6f brd ff:ff:ff:ff:ff:ff 4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether 08:00:27:b7:44:32 brd ff:ff:ff:ff:ff:ff opensuse-factory:~ # dmesg |grep udev [ 0.742013] systemd-udevd[173]: starting version 210 [ 1.935152] systemd-udevd[184]: renamed network interface eth1 to rename3 [ 1.939198] systemd-udevd[185]: renamed network interface eth0 to eth1 [ 1.988189] systemd-udevd[184]: renamed network interface rename3 to eth0 [ 2.612375] systemd-udevd[310]: starting version 210 opensuse-factory:~ # cat /proc/cmdline BOOT_IMAGE=/boot/vmlinuz-3.14.0-rc5-1-desktop root=UUID=4be0e30c-17f4-4e47-8126-a0b7c565dc6a elevator=noop apparmor=0 selinux=0 audit=0 resume=/dev/disk/by-uuid/3835bc7f-8b60-4315-a0b4-1cd3839a9532 splash=silent quiet -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=870537 https://bugzilla.novell.com/show_bug.cgi?id=870537#c Robert Milasan <rmilasan@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - None |P2 - High -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=870537 https://bugzilla.novell.com/show_bug.cgi?id=870537#c2 Dr. Werner Fink <werner@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEEDINFO InfoProvider| |rmilasan@suse.com --- Comment #2 from Dr. Werner Fink <werner@suse.com> 2014-03-27 08:41:50 UTC --- Hmmm ... what was/is wrong with current 1006-udev-always-rename-network.patch? AFAICS from systemd source code the rtnl_set_link_name() function has its own delay timer -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=870537 https://bugzilla.novell.com/show_bug.cgi?id=870537#c3 Robert Milasan <rmilasan@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |ASSIGNED InfoProvider|rmilasan@suse.com | --- Comment #3 from Robert Milasan <rmilasan@suse.com> 2014-03-27 08:59:29 UTC --- First as I've seen, the original code doesn't wait enough to actually change properly the network interface and split the if and while as to have a proper check and return the right info depending on the result of first rtnl_set_link_name. Anyway, this works (the above patch), but if you find a better way to deal with it, please do. This is in my own testing. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=870537 https://bugzilla.novell.com/show_bug.cgi?id=870537#c4 --- Comment #4 from Robert Milasan <rmilasan@suse.com> 2014-03-27 09:25:51 UTC --- BTW, I forgot to mention here that the changes to the patch are based on what worked before, meaning is very close to the original code which was known to work for us. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=870537 https://bugzilla.novell.com/show_bug.cgi?id=870537#c5 --- Comment #5 from Dr. Werner Fink <werner@suse.com> 2014-03-27 09:46:49 UTC --- (In reply to comment #4) This is fair enough ... I've only tested this with a virtual system (VirtualBox) but never with real hardware. Maybe the first delay after the temporary rename does the job. That would mean that testing for the link /sys/class/net/<new_name> may avoid such name space races. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=870537 https://bugzilla.novell.com/show_bug.cgi?id=870537#c6 --- Comment #6 from Robert Milasan <rmilasan@suse.com> 2014-03-27 09:48:36 UTC --- There is another bug very similar to what I've reported and asked the reported to test the rpm with the reworked patch. I'll let you know the results. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=870537 https://bugzilla.novell.com/show_bug.cgi?id=870537#c7 --- Comment #7 from Dr. Werner Fink <werner@suse.com> 2014-03-27 12:15:29 UTC --- Created an attachment (id=583946) --> (http://bugzilla.novell.com/attachment.cgi?id=583946) yet an other 1006-udev-always-rename-network.patch What do you think ... or better does this work for you, that means will the poll on the inotify of /sys/class/net/ work? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=870537 https://bugzilla.novell.com/show_bug.cgi?id=870537#c Dr. Werner Fink <werner@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEEDINFO InfoProvider| |rmilasan@suse.com -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=870537 https://bugzilla.novell.com/show_bug.cgi?id=870537#c8 Robert Milasan <rmilasan@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- InfoProvider|rmilasan@suse.com |werner@suse.com --- Comment #8 from Robert Milasan <rmilasan@suse.com> 2014-03-27 12:42:32 UTC --- My question is simple: why so complex when the inital reworked patch works? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=870537 https://bugzilla.novell.com/show_bug.cgi?id=870537#c9 Dr. Werner Fink <werner@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |ASSIGNED InfoProvider|werner@suse.com | --- Comment #9 from Dr. Werner Fink <werner@suse.com> 2014-03-27 12:54:12 UTC --- (In reply to comment #8) Simply to avoid a half second to wait on an new but already existing network interface name. I'd like to know if this does work as I can not trigger the poll for the rename here ... it works on the first try. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=870537 https://bugzilla.novell.com/show_bug.cgi?id=870537#c10 --- Comment #10 from Robert Milasan <rmilasan@suse.com> 2014-03-27 13:00:46 UTC --- I'll try your patch now and will see if there is a difference. What I believe that the extra wait actually helps the proper rename. We use this way to rename interfaces since udev 128 or so and worked well (the rename itself). -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=870537 https://bugzilla.novell.com/show_bug.cgi?id=870537#c11 Robert Milasan <rmilasan@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEEDINFO InfoProvider| |werner@suse.com --- Comment #11 from Robert Milasan <rmilasan@suse.com> 2014-03-27 13:10:01 UTC --- OK, here is the test output: opensuse-factory:~ # dmesg |grep udev [ 0.613229] systemd[1]: Starting udev Control Socket. [ 0.613263] systemd[1]: Listening on udev Control Socket. [ 0.613279] systemd[1]: Starting udev Kernel Socket. [ 0.613305] systemd[1]: Listening on udev Kernel Socket. [ 0.750196] systemd-udevd[174]: starting version 210 [ 1.945135] systemd-udevd[184]: renamed network interface eth1 to rename3 [ 1.949185] systemd-udevd[185]: renamed network interface eth0 to eth1 [ 34.249449] systemd-udevd[302]: starting version 210 [ 34.450185] systemd-udevd[342]: renamed network interface rename3 to enp0s8 opensuse-factory:~ # ip l 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether 08:00:27:90:de:7b brd ff:ff:ff:ff:ff:ff 3: enp0s8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether 08:00:27:50:e2:6f brd ff:ff:ff:ff:ff:ff 4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether 08:00:27:b7:44:32 brd ff:ff:ff:ff:ff:ff opensuse-factory:~ # The patch make things even worst then the original patch. Look at the time taken to rename rename3 to enp0s8, not to mention, they are not all ethX, but one of them is enp0s8. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=870537 https://bugzilla.novell.com/show_bug.cgi?id=870537#c12 Robert Milasan <rmilasan@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #583905|0 |1 is obsolete| | --- Comment #12 from Robert Milasan <rmilasan@suse.com> 2014-03-28 08:17:57 UTC --- Created an attachment (id=584144) --> (http://bugzilla.novell.com/attachment.cgi?id=584144) 1006-udev-always-rename-network.patch A newer version of the patch from comment #0. Just a bit of clean-up, nothing else. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=870537 https://bugzilla.novell.com/show_bug.cgi?id=870537#c13 Dr. Werner Fink <werner@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |ASSIGNED InfoProvider|werner@suse.com | --- Comment #13 from Dr. Werner Fink <werner@suse.com> 2014-03-28 08:27:13 UTC --- (In reply to comment #12) I'm using a similar version ... the "int loop" I've moved into the declaration section due gxx warnings and in the while loop I use break instead of return. See current factory version. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=870537 https://bugzilla.novell.com/show_bug.cgi?id=870537#c14 Robert Milasan <rmilasan@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEEDINFO InfoProvider| |werner@suse.com --- Comment #14 from Robert Milasan <rmilasan@suse.com> 2014-03-28 08:31:46 UTC --- Werner, please drop '+#include <sys/inotify.h>' from the patch. Dont think we need it :) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=870537 https://bugzilla.novell.com/show_bug.cgi?id=870537#c16 --- Comment #16 from Dr. Werner Fink <werner@suse.com> 2014-03-28 08:34:28 UTC --- (In reply to comment #14) Indeed ;} -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=870537 https://bugzilla.novell.com/show_bug.cgi?id=870537#c17 --- Comment #17 from Robert Milasan <rmilasan@suse.com> 2014-03-28 08:37:18 UTC --- BTW, I saw some issues with IBS/OBS, so maybe... thats the problem. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=870537 https://bugzilla.novell.com/show_bug.cgi?id=870537#c18 Robert Milasan <rmilasan@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED --- Comment #18 from Robert Milasan <rmilasan@suse.com> 2014-06-01 18:39:19 UTC --- Fixed. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com