rcu_read_unlock_bh();
if (l2tp_wq) {
- /* ensure that all TUNNEL_DELETE work items are run before
- * draining the work queue since TUNNEL_DELETE requests may
- * queue SESSION_DELETE work items for each session in the
- * tunnel. drain_workqueue may otherwise warn if SESSION_DELETE
- * requests are queued while the work queue is being drained.
+ /* Run all TUNNEL_DELETE work items just queued. */
+ __flush_workqueue(l2tp_wq);
+
+ /* Each TUNNEL_DELETE work item will queue a SESSION_DELETE
+ * work item for each session in the tunnel. Flush the
+ * workqueue again to process these.
*/
__flush_workqueue(l2tp_wq);
- drain_workqueue(l2tp_wq);
}
}
{
struct l2tp_net *pn = l2tp_pernet(net);
+ WARN_ON_ONCE(!idr_is_empty(&pn->l2tp_v2_session_idr));
idr_destroy(&pn->l2tp_v2_session_idr);
+ WARN_ON_ONCE(!idr_is_empty(&pn->l2tp_v3_session_idr));
idr_destroy(&pn->l2tp_v3_session_idr);
+ WARN_ON_ONCE(!idr_is_empty(&pn->l2tp_tunnel_idr));
idr_destroy(&pn->l2tp_tunnel_idr);
}