Skip to content
Snippets Groups Projects
Commit 73d33bd0 authored by James Chapman's avatar James Chapman Committed by Jakub Kicinski
Browse files

l2tp: avoid using drain_workqueue in l2tp_pre_exit_net


Recent commit fc7ec7f5 ("l2tp: delete sessions using work queue")
incorrectly uses drain_workqueue. The use of drain_workqueue in
l2tp_pre_exit_net is flawed because the workqueue is shared by all
nets and it is therefore possible for new work items to be queued
for other nets while drain_workqueue runs.

Instead of using drain_workqueue, use __flush_workqueue twice. The
first one will run all tunnel delete work items and any work already
queued. When tunnel delete work items are run, they may queue
new session delete work items, which the second __flush_workqueue will
run.

In l2tp_exit_net, warn if any of the net's idr lists are not empty.

Fixes: fc7ec7f5 ("l2tp: delete sessions using work queue")
Signed-off-by: default avatarJames Chapman <jchapman@katalix.com>
Link: https://patch.msgid.link/20240823142257.692667-1-jchapman@katalix.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent aed7136a
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment