diff options
author | James Chapman <jchapman@katalix.com> | 2024-08-23 17:22:57 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-08-27 23:37:22 +0300 |
commit | 73d33bd063c4cfef3db17f9bec3d202928ed8631 (patch) | |
tree | 233e222bc0b7052fa98eff2cd137fda7567be92b /CREDITS | |
parent | aed7136a37148465dcc899b806584fe70fd4ae72 (diff) | |
download | linux-73d33bd063c4cfef3db17f9bec3d202928ed8631.tar.xz |
l2tp: avoid using drain_workqueue in l2tp_pre_exit_net
Recent commit fc7ec7f554d7 ("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: fc7ec7f554d7 ("l2tp: delete sessions using work queue")
Signed-off-by: James Chapman <jchapman@katalix.com>
Link: https://patch.msgid.link/20240823142257.692667-1-jchapman@katalix.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'CREDITS')
0 files changed, 0 insertions, 0 deletions