netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.6] vlan - device refcount bug.
@ 2004-08-03 20:14 Stephen Hemminger
  2004-08-03 20:36 ` Ben Greear
  2004-08-09 23:49 ` David S. Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Stephen Hemminger @ 2004-08-03 20:14 UTC (permalink / raw)
  To: Ben Greear, David S. Miller; +Cc: netdev

If you rmmod a network device that is in a vlan, the system hangs waiting
for the refcount to go to zero, because it is -1.  The problem is that the
vlan notifier does an extra dev_put in NETDEV_UNREGISTER case of notifier.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>

diff -Nru a/net/8021q/vlan.c b/net/8021q/vlan.c
--- a/net/8021q/vlan.c	2004-08-03 13:13:33 -07:00
+++ b/net/8021q/vlan.c	2004-08-03 13:13:33 -07:00
@@ -645,7 +645,6 @@
 			ret = unregister_vlan_dev(dev,
 						  VLAN_DEV_INFO(vlandev)->vlan_id);
 
-			dev_put(vlandev);
 			unregister_netdevice(vlandev);
 
 			/* Group was destroyed? */

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

* Re: [PATCH 2.6] vlan - device refcount bug.
  2004-08-03 20:14 [PATCH 2.6] vlan - device refcount bug Stephen Hemminger
@ 2004-08-03 20:36 ` Ben Greear
  2004-08-09 23:49   ` David S. Miller
  2004-08-09 23:49 ` David S. Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Ben Greear @ 2004-08-03 20:36 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: David S. Miller, netdev

Stephen Hemminger wrote:
> If you rmmod a network device that is in a vlan, the system hangs waiting
> for the refcount to go to zero, because it is -1.  The problem is that the
> vlan notifier does an extra dev_put in NETDEV_UNREGISTER case of notifier.

Good catch.  It would seem to me that it would be good to have a
BUG() or similar to catch any instance of the reference count going
negative.

Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

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

* Re: [PATCH 2.6] vlan - device refcount bug.
  2004-08-03 20:14 [PATCH 2.6] vlan - device refcount bug Stephen Hemminger
  2004-08-03 20:36 ` Ben Greear
@ 2004-08-09 23:49 ` David S. Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David S. Miller @ 2004-08-09 23:49 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: greearb, netdev

On Tue, 3 Aug 2004 13:14:25 -0700
Stephen Hemminger <shemminger@osdl.org> wrote:

> If you rmmod a network device that is in a vlan, the system hangs waiting
> for the refcount to go to zero, because it is -1.  The problem is that the
> vlan notifier does an extra dev_put in NETDEV_UNREGISTER case of notifier.

Applied.

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

* Re: [PATCH 2.6] vlan - device refcount bug.
  2004-08-03 20:36 ` Ben Greear
@ 2004-08-09 23:49   ` David S. Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David S. Miller @ 2004-08-09 23:49 UTC (permalink / raw)
  To: Ben Greear; +Cc: shemminger, netdev

On Tue, 03 Aug 2004 13:36:16 -0700
Ben Greear <greearb@candelatech.com> wrote:

> Stephen Hemminger wrote:
> > If you rmmod a network device that is in a vlan, the system hangs waiting
> > for the refcount to go to zero, because it is -1.  The problem is that the
> > vlan notifier does an extra dev_put in NETDEV_UNREGISTER case of notifier.
> 
> Good catch.  It would seem to me that it would be good to have a
> BUG() or similar to catch any instance of the reference count going
> negative.

I'd likely accept such a patch. :-)

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

end of thread, other threads:[~2004-08-09 23:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-03 20:14 [PATCH 2.6] vlan - device refcount bug Stephen Hemminger
2004-08-03 20:36 ` Ben Greear
2004-08-09 23:49   ` David S. Miller
2004-08-09 23:49 ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).