All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net-persistence fails when adding new NIC and still having /
@ 2007-02-14 14:12 Matthias Schwarzott
  2007-02-19 12:16 ` [PATCH] net-persistence fails when adding new NIC and still Matthias Schwarzott
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Matthias Schwarzott @ 2007-02-14 14:12 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 2354 bytes --]

Hi list!

This time I have a quite ugly bug.
For reference: http://bugs.gentoo.org/show_bug.cgi?id=166486

Short form:
Adding a new NIC leaves a system which takes 30sec more on udevstart, and 
after that has network interfaces eth0, eth1 and eth1_rename or similar.

Using udev-104 (with net-rename related patches from udev-105).
Reproduce:
1. Have 1 or more NICs already in the system (here: eth0 eth1).
2. udev already has created 70-persistent-net.rules, setting names to: eth0 
eth1

3. Now insert another NIC into the system and boot:
4. Then at boot for newest NIC write_net_rules get called.

5. write_net_rules detects that /etc/udev/rules.d/ is read only that point and 
decides to write to /dev/.udev/tmp-rules-*:
RULES_FILE=/dev/.udev/tmp-rules--.....

6. Now problem is: When checking for already used names it does this first:
[ -e $RULES_FILE ] || return
Sadly $RULES_FILE does not exist at that point, thus it skips to also look 
into /etc/udev/rules.d/70-persistent-net.rules

7. Two possible cases:
a) newest NIC gets eth2 from kernel.
Not checking already used netif names does not harm and udev writes eth2 down 
to the file.

b) newest NIC gets name already used (here: eth0) and other nics get higher 
numbers.
Now missing check tells write_net_rules that eth0 is free for use => it writes 
a rule using it and also writes it to stdout for direct usage.


8. udev enters the netif rename code for all interfaces (at same time).
a) In this case all interfaces get unique new names and it will work (with 
eth?_rename only being a tmp name for one loop or so).

b) udev enters a loop in which two interfaces try to rename themselves to same 
name (here: eth0).

The new NIC already has eth0 => stays so.
The old NIC that has ever been eth0 (and at this boot is eth1) gets renamed to 
eth1_rename (for making place for real owner of eth1).
But then renaming to eth0 must fail (name already used).
This failing leads to a busy waiting loop for exactly 30sec.

After that we have:
eth0: new NIC that should be eth2
eth1: correct name assigned
eth1_rename: nic that should be eth0


Deleting the (wrong) check from 6. solves this (Patch attached).

It could also be replaced by a more versatile check but I think that is not 
necessary (somewhere integrated with read-only detection).

Greetings
Matthias

-- 
Matthias Schwarzott (zzam)

[-- Attachment #2: udev-104-persistent-net-fix-name-dups.patch --]
[-- Type: text/x-diff, Size: 573 bytes --]

diff -ru udev-104-orig/extras/rule_generator/rule_generator.functions udev-104/extras/rule_generator/rule_generator.functions
--- udev-104-orig/extras/rule_generator/rule_generator.functions	2007-01-15 14:56:11.000000000 +0100
+++ udev-104/extras/rule_generator/rule_generator.functions	2007-02-12 13:17:39.000000000 +0100
@@ -92,7 +92,6 @@
 	local linkre="$2"
 	local match="$3"
 
-	[ -e $RULES_FILE ] || return
 	local search='.*[[:space:],]'"$key"'"\('"$linkre"'\)"[[:space:]]*\(,.*\|\\\|\)$'
 	echo $(sed -n -e "${match}s/${search}/\1/p" $RO_RULES_FILE $RULES_FILE)
 }

[-- Attachment #3: Type: text/plain, Size: 345 bytes --]

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

[-- Attachment #4: Type: text/plain, Size: 226 bytes --]

_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] net-persistence fails when adding new NIC and still
  2007-02-14 14:12 [PATCH] net-persistence fails when adding new NIC and still having / Matthias Schwarzott
@ 2007-02-19 12:16 ` Matthias Schwarzott
  2007-02-26 11:02 ` Matthias Schwarzott
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Matthias Schwarzott @ 2007-02-19 12:16 UTC (permalink / raw)
  To: linux-hotplug

Hi!

I did a little digging, and I think these Debian-Bug-reports are also 
describing this problem/a similar one:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug@8750
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug@5845
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug@6948

All being symptomes for same error:
That is write_net_rules not reading existing rules-file.

Matthias


-- 
Matthias Schwarzott (zzam)

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] net-persistence fails when adding new NIC and still
  2007-02-14 14:12 [PATCH] net-persistence fails when adding new NIC and still having / Matthias Schwarzott
  2007-02-19 12:16 ` [PATCH] net-persistence fails when adding new NIC and still Matthias Schwarzott
@ 2007-02-26 11:02 ` Matthias Schwarzott
  2007-02-26 11:26 ` Marco d'Itri
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Matthias Schwarzott @ 2007-02-26 11:02 UTC (permalink / raw)
  To: linux-hotplug

On Mittwoch, 14. Februar 2007, Matthias Schwarzott wrote:
> Hi list!
>
> This time I have a quite ugly bug.
> For reference: http://bugs.gentoo.org/show_bug.cgi?id\x166486
>
> Short form:
> Adding a new NIC leaves a system which takes 30sec more on udevstart, and
> after that has network interfaces eth0, eth1 and eth1_rename or similar.

>
> Deleting the (wrong) check from 6. solves this (Patch attached).
>

Anything speaking against commiting this patch?

Matthias
-- 
Matthias Schwarzott (zzam)

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] net-persistence fails when adding new NIC and still
  2007-02-14 14:12 [PATCH] net-persistence fails when adding new NIC and still having / Matthias Schwarzott
  2007-02-19 12:16 ` [PATCH] net-persistence fails when adding new NIC and still Matthias Schwarzott
  2007-02-26 11:02 ` Matthias Schwarzott
@ 2007-02-26 11:26 ` Marco d'Itri
  2007-02-26 14:11 ` Kay Sievers
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Marco d'Itri @ 2007-02-26 11:26 UTC (permalink / raw)
  To: linux-hotplug

On Feb 26, Matthias Schwarzott <zzam@gentoo.org> wrote:

> Anything speaking against commiting this patch?
I uploaded a new Debian package with the change, but I did not really
think much about it. (Why did I add that check in the first place?)

-- 
ciao,
Marco

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] net-persistence fails when adding new NIC and still
  2007-02-14 14:12 [PATCH] net-persistence fails when adding new NIC and still having / Matthias Schwarzott
                   ` (2 preceding siblings ...)
  2007-02-26 11:26 ` Marco d'Itri
@ 2007-02-26 14:11 ` Kay Sievers
  2007-02-26 14:17 ` Marco d'Itri
  2007-02-26 17:16 ` Kay Sievers
  5 siblings, 0 replies; 7+ messages in thread
From: Kay Sievers @ 2007-02-26 14:11 UTC (permalink / raw)
  To: linux-hotplug

On 2/26/07, Marco d'Itri <md@linux.it> wrote:
> On Feb 26, Matthias Schwarzott <zzam@gentoo.org> wrote:
>
> > Anything speaking against commiting this patch?
> I uploaded a new Debian package with the change, but I did not really
> think much about it. (Why did I add that check in the first place?)

Nice. I've applied it to the udev tree too now.

Thanks,
Kay

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] net-persistence fails when adding new NIC and still
  2007-02-14 14:12 [PATCH] net-persistence fails when adding new NIC and still having / Matthias Schwarzott
                   ` (3 preceding siblings ...)
  2007-02-26 14:11 ` Kay Sievers
@ 2007-02-26 14:17 ` Marco d'Itri
  2007-02-26 17:16 ` Kay Sievers
  5 siblings, 0 replies; 7+ messages in thread
From: Marco d'Itri @ 2007-02-26 14:17 UTC (permalink / raw)
  To: linux-hotplug

On Feb 26, Kay Sievers <kay.sievers@vrfy.org> wrote:

> > > Anything speaking against commiting this patch?
> > I uploaded a new Debian package with the change, but I did not really
> > think much about it. (Why did I add that check in the first place?)
> Nice. I've applied it to the udev tree too now.
I did not actually say that it's correct, just that I have applied it.
:-)

-- 
ciao,
Marco

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] net-persistence fails when adding new NIC and still
  2007-02-14 14:12 [PATCH] net-persistence fails when adding new NIC and still having / Matthias Schwarzott
                   ` (4 preceding siblings ...)
  2007-02-26 14:17 ` Marco d'Itri
@ 2007-02-26 17:16 ` Kay Sievers
  5 siblings, 0 replies; 7+ messages in thread
From: Kay Sievers @ 2007-02-26 17:16 UTC (permalink / raw)
  To: linux-hotplug

On 2/26/07, Marco d'Itri <md@linux.it> wrote:
> On Feb 26, Kay Sievers <kay.sievers@vrfy.org> wrote:
>
> > > > Anything speaking against commiting this patch?
> > > I uploaded a new Debian package with the change, but I did not really
> > > think much about it. (Why did I add that check in the first place?)
> > Nice. I've applied it to the udev tree too now.
> I did not actually say that it's correct, just that I have applied it.
> :-)

Hehe, that's how it works sometimes, to find out what is correct. If
nobody complains now, it probably was. :)

Kay

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-02-26 17:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-14 14:12 [PATCH] net-persistence fails when adding new NIC and still having / Matthias Schwarzott
2007-02-19 12:16 ` [PATCH] net-persistence fails when adding new NIC and still Matthias Schwarzott
2007-02-26 11:02 ` Matthias Schwarzott
2007-02-26 11:26 ` Marco d'Itri
2007-02-26 14:11 ` Kay Sievers
2007-02-26 14:17 ` Marco d'Itri
2007-02-26 17:16 ` Kay Sievers

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.