netdev
[Top] [All Lists]

Re: [PATCH] panic during unregister_netdevice()

To: Stephen Hemminger <shemminger@xxxxxxxx>
Subject: Re: [PATCH] panic during unregister_netdevice()
From: Krishna Kumar <kumarkr@xxxxxxxxxx>
Date: Wed, 5 Nov 2003 16:42:12 -0800
Cc: davem@xxxxxxxxxx, krkumar@xxxxxxxxxx, netdev@xxxxxxxxxxx
Sender: netdev-bounce@xxxxxxxxxxx



> Hey, what if the dev refcount goes to zero before your dev_hold?

Actually, that is what I had written in my second mail.

> I would argue even running the loop once means some protocol is busted.

I have seen a message regarding ref count of 1, some delay and then the
rmmod works fine. So it
doesn't seem busted.

- KK



|---------+---------------------------->
|         |           Stephen Hemminger|
|         |           <shemminger@osdl.|
|         |           org>             |
|         |           Sent by:         |
|         |           netdev-bounce@oss|
|         |           .sgi.com         |
|         |                            |
|         |                            |
|         |           11/05/2003 04:30 |
|         |           PM               |
|         |                            |
|---------+---------------------------->
  
>-----------------------------------------------------------------------------------------------------------------|
  |                                                                             
                                    |
  |       To:       krkumar@xxxxxxxxxxxxxxxxxxxxxxx                             
                                    |
  |       cc:       davem@xxxxxxxxxx, netdev@xxxxxxxxxxx                        
                                    |
  |       Subject:  Re: [PATCH] panic during unregister_netdevice()             
                                    |
  |                                                                             
                                    |
  
>-----------------------------------------------------------------------------------------------------------------|





>
> diff -ruN linux-2.6.0-test9-bk9/net/core/dev.c
linux-2.6.0-test9-bk9.new/net/core/dev.c
> --- linux-2.6.0-test9-bk9/net/core/dev.c             2003-11-05
15:43:21.000000000 -0800
> +++ linux-2.6.0-test9-bk9.new/net/core/dev.c         2003-11-05
15:43:50.000000000 -0800
> @@ -2749,8 +2749,10 @@
>                                    rtnl_exlock();
>
>                                    /* Rebroadcast unregister notification
*/
> +                                  dev_hold(dev);
>                                    notifier_call_chain(&netdev_chain,
>
NETDEV_UNREGISTER, dev);
> +                                  dev_put(dev);
>
>                                    if
(test_bit(__LINK_STATE_LINKWATCH_PENDING,
>                                                     &dev->state)) {
>

Hey, what if the dev refcount goes to zero before your dev_hold?
Actually this repeated notifier looks like it wouldn't work anyway.
Why would a protocol drop it's reference when notified a second time?

I would argue even running the loop once means some protocol is busted.





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