* Re: [PATCH 2.5.70] Tun device encapsulation
2003-06-04 22:40 ` [PATCH 2.5.70] Tun device encapsulation Stephen Hemminger
@ 2003-06-04 22:46 ` jjs
2003-06-05 5:33 ` Joe
2003-06-05 6:50 ` David S. Miller
2 siblings, 0 replies; 4+ messages in thread
From: jjs @ 2003-06-04 22:46 UTC (permalink / raw)
To: Stephen Hemminger
Cc: Arnaldo Carvalho de Melo, David S. Miller, Jeff Garzik, akpm,
netdev
I'll be happy to test it out later -
Thanks,
Joe
Stephen Hemminger wrote:
>Tun device was encapsulating the net_device in a private structure then doing:
> unregister_netdev(&tun->dev);
> kfree(tun);
> rtnl_unlock();
>
>This breaks with the delayed cleanup now in the network core.
>Moving the kfree outside of the rtnl_unlock will fix it.
>
>Builds, but not sure how to use TUN to test it.
>
>As part of later refcounting changes, I do have a more complex change
>that uses the same encapsulation as ethernet and other
>devices. Will save it for later.
>
>diff -Nru a/drivers/net/tun.c b/drivers/net/tun.c
>--- a/drivers/net/tun.c Wed Jun 4 15:38:44 2003
>+++ b/drivers/net/tun.c Wed Jun 4 15:38:44 2003
>@@ -551,10 +551,12 @@
> if (!(tun->flags & TUN_PERSIST)) {
> dev_close(&tun->dev);
> unregister_netdevice(&tun->dev);
>- kfree(tun);
> }
>
> rtnl_unlock();
>+
>+ if (!(tun->flags & TUN_PERSIST))
>+ kfree(tun);
> return 0;
> }
>
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH 2.5.70] Tun device encapsulation
2003-06-04 22:40 ` [PATCH 2.5.70] Tun device encapsulation Stephen Hemminger
2003-06-04 22:46 ` jjs
@ 2003-06-05 5:33 ` Joe
2003-06-05 6:50 ` David S. Miller
2 siblings, 0 replies; 4+ messages in thread
From: Joe @ 2003-06-05 5:33 UTC (permalink / raw)
To: Stephen Hemminger
Cc: Arnaldo Carvalho de Melo, David S. Miller, Jeff Garzik, akpm, jjs,
netdev
This fixes the tun problem nicely here -
Joe
Stephen Hemminger wrote:
>Tun device was encapsulating the net_device in a private structure then doing:
> unregister_netdev(&tun->dev);
> kfree(tun);
> rtnl_unlock();
>
>This breaks with the delayed cleanup now in the network core.
>Moving the kfree outside of the rtnl_unlock will fix it.
>
>Builds, but not sure how to use TUN to test it.
>
>As part of later refcounting changes, I do have a more complex change
>that uses the same encapsulation as ethernet and other
>devices. Will save it for later.
>
>diff -Nru a/drivers/net/tun.c b/drivers/net/tun.c
>--- a/drivers/net/tun.c Wed Jun 4 15:38:44 2003
>+++ b/drivers/net/tun.c Wed Jun 4 15:38:44 2003
>@@ -551,10 +551,12 @@
> if (!(tun->flags & TUN_PERSIST)) {
> dev_close(&tun->dev);
> unregister_netdevice(&tun->dev);
>- kfree(tun);
> }
>
> rtnl_unlock();
>+
>+ if (!(tun->flags & TUN_PERSIST))
>+ kfree(tun);
> return 0;
> }
>
>
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH 2.5.70] Tun device encapsulation
2003-06-04 22:40 ` [PATCH 2.5.70] Tun device encapsulation Stephen Hemminger
2003-06-04 22:46 ` jjs
2003-06-05 5:33 ` Joe
@ 2003-06-05 6:50 ` David S. Miller
2 siblings, 0 replies; 4+ messages in thread
From: David S. Miller @ 2003-06-05 6:50 UTC (permalink / raw)
To: shemminger; +Cc: acme, jgarzik, akpm, jjs, netdev
From: Stephen Hemminger <shemminger@osdl.org>
Date: Wed, 4 Jun 2003 15:40:22 -0700
Tun device was encapsulating the net_device in a private structure
then doing:
unregister_netdev(&tun->dev);
kfree(tun);
rtnl_unlock();
This breaks with the delayed cleanup now in the network core.
Moving the kfree outside of the rtnl_unlock will fix it.
Builds, but not sure how to use TUN to test it.
This seems to indeed fix the problem for people, applied thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread