Skip to content

Commit 92df4c5

Browse files
committed
netfilter: conntrack: warn when cleanup is stuck
nf_conntrack_cleanup_net_list() calls schedule() so it does not show up as a hung task. Add an explicit check to make debugging leaked skbs/conntack references more obvious. Acked-by: Florian Westphal <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 006a503 commit 92df4c5

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

net/netfilter/nf_conntrack_core.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2487,6 +2487,7 @@ void nf_conntrack_cleanup_net(struct net *net)
24872487
void nf_conntrack_cleanup_net_list(struct list_head *net_exit_list)
24882488
{
24892489
struct nf_ct_iter_data iter_data = {};
2490+
unsigned long start = jiffies;
24902491
struct net *net;
24912492
int busy;
24922493

@@ -2507,6 +2508,8 @@ void nf_conntrack_cleanup_net_list(struct list_head *net_exit_list)
25072508
busy = 1;
25082509
}
25092510
if (busy) {
2511+
DEBUG_NET_WARN_ONCE(time_after(jiffies, start + 60 * HZ),
2512+
"conntrack cleanup blocked for 60s");
25102513
schedule();
25112514
goto i_see_dead_people;
25122515
}

0 commit comments

Comments
 (0)