Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: use WARN_ON_ONCE() in sk_stream_kill_queues()

sk_stream_kill_queues() has three checks which have been
useful to detect kernel bugs in the past.

However they are potentially a problem because they
could flood the syslog.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Eric Dumazet and committed by
Jakub Kicinski
c59f02f8 3e7f2b8d

+3 -3
+3 -3
net/core/stream.c
··· 196 196 __skb_queue_purge(&sk->sk_receive_queue); 197 197 198 198 /* Next, the write queue. */ 199 - WARN_ON(!skb_queue_empty(&sk->sk_write_queue)); 199 + WARN_ON_ONCE(!skb_queue_empty(&sk->sk_write_queue)); 200 200 201 201 /* Account for returned memory. */ 202 202 sk_mem_reclaim_final(sk); 203 203 204 - WARN_ON(sk->sk_wmem_queued); 205 - WARN_ON(sk->sk_forward_alloc); 204 + WARN_ON_ONCE(sk->sk_wmem_queued); 205 + WARN_ON_ONCE(sk->sk_forward_alloc); 206 206 207 207 /* It is _impossible_ for the backlog to contain anything 208 208 * when we get here. All user references to this socket