netdev
[Top] [All Lists]

Re: Frequent Oops on Shutdown 2.6.10

To: YOSHIFUJI Hideaki / ???? <yoshfuji@xxxxxxxxxxxxxx>
Subject: Re: Frequent Oops on Shutdown 2.6.10
From: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 22 Feb 2005 21:15:26 +1100
Cc: AndyLiebman@xxxxxxx, terryg@xxxxxxxxx, netdev@xxxxxxxxxxx, davem@xxxxxxxxxxxxx, akpm@xxxxxxxx
In-reply-to: <E1D3Wn9-00071h-00@xxxxxxxxxxxxxxxxxxxxxxxx>
References: <20050221.162949.65179228.yoshfuji@xxxxxxxxxxxxxx> <E1D3Wn9-00071h-00@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.5.6+20040722i
On Tue, Feb 22, 2005 at 08:57:19PM +1100, Herbert Xu wrote:
> YOSHIFUJI Hideaki / ???? <yoshfuji@xxxxxxxxxxxxxx> wrote:
> > In article <20050221.162241.24618885.yoshfuji@xxxxxxxxxxxxxx> (at Mon, 21 
> > Feb 2005 16:22:41 +0900 (JST)), YOSHIFUJI Hideaki / ???? 
> > <yoshfuji@xxxxxxxxxxxxxx> says:
> > 
> >> [IPV6] Don't remove dev_snmp6 procfs entry until all users gone.
> 
> Sorry, but I don't see how this patch explains the oops the
> people saw.

OK, I think I see what you were trying to fix now.  Unfortunately
I think this patch doesn't quite cure the problem.

First of all you can't sleep in snmp6_unregister_dev so semaphores
are out.  More importantly, the race is still on.

Here is what happens:

CPU0                                    CPU1
ifdown eth0
        ...
                                        ifup eth0
                                                snmp6_register_dev
                                                        adds proc entry
in6_dev_finish_destroy
        snmp6_unregister_dev
                deletes new proc entry

The next ifdown may fail because snmp6_unregister_dev will retrieve the
name from a proc entry that's already been deleted.

I see two solutions:

1) Unregister the proc entry earlier.  In other words, do it in
addrconf_ifdown.  Since this is highly serialised it means that
we can't add the new proc entry before the old proc entry has
been deleted.

2) Fix procfs so that we delete by pointer instead of name.  This
makes sense from a semantic pointer of view.  However, for this
particular instance it means that we may have two "eth0" entries
for as long as the old idev entry sticks around.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

<Prev in Thread] Current Thread [Next in Thread>