• James Chapman's avatar
    l2tp: delete sessions using work queue · fc7ec7f5
    James Chapman authored
    When a tunnel is closed, l2tp_tunnel_closeall closes all sessions in
    the tunnel. Move the work of deleting each session to the work queue
    so that sessions are deleted using the same codepath whether they are
    closed by user API request or their parent tunnel is closing. This
    also avoids the locking dance in l2tp_tunnel_closeall where the
    tunnel's session list lock was unlocked and relocked in the loop.
    
    In l2tp_exit_net, use drain_workqueue instead of flush_workqueue
    because the processing of tunnel_delete work may queue session_delete
    work items which must also be processed.
    Signed-off-by: default avatarJames Chapman <jchapman@katalix.com>
    Signed-off-by: default avatarTom Parkin <tparkin@katalix.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    fc7ec7f5
l2tp_core.c 47.4 KB