All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] l2tp: don't close sessions in l2tp_tunnel_destruct()
@ 2017-11-08 23:29 Guillaume Nault
  2017-11-11 10:07 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Guillaume Nault @ 2017-11-08 23:29 UTC (permalink / raw)
  To: netdev; +Cc: James Chapman

Sessions are already removed by the proto ->destroy() handlers, and
since commit f3c66d4e144a ("l2tp: prevent creation of sessions on terminated tunnels"),
we're guaranteed that no new session can be created afterwards.

Furthermore, l2tp_tunnel_closeall() can sleep when there are sessions
left to close. So we really shouldn't call it in a ->sk_destruct()
handler, as it can be used from atomic context.

Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
---
 net/l2tp/l2tp_core.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c
index 7c8d1eb757a5..350fcd39ebd8 100644
--- a/net/l2tp/l2tp_core.c
+++ b/net/l2tp/l2tp_core.c
@@ -1246,8 +1246,6 @@ static void l2tp_tunnel_destruct(struct sock *sk)
 	list_del_rcu(&tunnel->list);
 	spin_unlock_bh(&pn->l2tp_tunnel_list_lock);
 
-	l2tp_tunnel_closeall(tunnel);
-
 	tunnel->sock = NULL;
 	l2tp_tunnel_dec_refcount(tunnel);
 
-- 
2.11.0

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

* Re: [PATCH net-next] l2tp: don't close sessions in l2tp_tunnel_destruct()
  2017-11-08 23:29 [PATCH net-next] l2tp: don't close sessions in l2tp_tunnel_destruct() Guillaume Nault
@ 2017-11-11 10:07 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-11-11 10:07 UTC (permalink / raw)
  To: g.nault; +Cc: netdev, jchapman

From: Guillaume Nault <g.nault@alphalink.fr>
Date: Thu, 9 Nov 2017 08:29:52 +0900

> Sessions are already removed by the proto ->destroy() handlers, and
> since commit f3c66d4e144a ("l2tp: prevent creation of sessions on terminated tunnels"),
> we're guaranteed that no new session can be created afterwards.
> 
> Furthermore, l2tp_tunnel_closeall() can sleep when there are sessions
> left to close. So we really shouldn't call it in a ->sk_destruct()
> handler, as it can be used from atomic context.
> 
> Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>

Applied, thank you.

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

end of thread, other threads:[~2017-11-11 10:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-08 23:29 [PATCH net-next] l2tp: don't close sessions in l2tp_tunnel_destruct() Guillaume Nault
2017-11-11 10:07 ` David Miller

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.