Bug#765577: (no subject)

Marco d'Itri md at Linux.IT
Mon Mar 30 05:06:47 BST 2015


On Mar 18, Faidon Liambotis <paravoid at debian.org> wrote:

> Well, the root cause IMO is that 75-persistent-net-generator.rules is
> inherently susceptible to races. It's my understanding that it's valid
> for events to be triggered multiple times -- there are multiple places
> in d-i that "udevadm trigger" is called, including start-udev (as
> shipped by udev-udeb) which would trigger another set of "add" events
> beyond the original "hotplug" one.
I do not think that this is "valid" in the sense that the kernel could 
generate multiple add events, but removing all misuses of udevadm 
trigger requires some work and may not even be possible at this time.

I see that we have independently devised the same fix, I am attaching 
a test case and a more refined version of your patch.

-- 
ciao,
Marco
-------------- next part --------------
#!/bin/sh -e

rm -f /etc/udev/rules.d/70-persistent-net.rules

rmmod e1000e || true
modprobe e1000e
sleep 1

rm -f /etc/udev/rules.d/70-persistent-net.rules

iteration=0

while : ; do
  iteration=$((iteration + 1))
  if ! echo add > /sys/class/net/eth0/uevent; then
    echo "Failed at iteration $iteration!"
    exit
  fi
  # do not send too many events to udev because they will all be queued
  # and eventually processed
  if [ $iteration -eq 2500 ]; then
    echo "Aborting at iteration $iteration!"
    exit
  fi
done

-------------- next part --------------
A non-text attachment was scrubbed...
Name: net_rules_race.diff
Type: text/x-diff
Size: 889 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20150330/d5ca9f24/attachment-0002.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 648 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20150330/d5ca9f24/attachment-0002.sig>


More information about the Pkg-systemd-maintainers mailing list