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

Revert "net: correct sk_acceptq_is_full()"

This reverts commit f211ac154577ec9ccf07c15f18a6abf0d9bdb4ab.

We had similar attempt in the past, and we reverted it.

History:

64a146513f8f12ba204b7bf5cb7e9505594ead42 [NET]: Revert incorrect accept queue backlog changes.
8488df894d05d6fa41c2bd298c335f944bb0e401 [NET]: Fix bugs in "Whether sock accept queue is full" checking

I am adding a fat comment so that future attempts will
be much harder.

Fixes: f211ac154577 ("net: correct sk_acceptq_is_full()")
Cc: iuyacan <yacanliu@163.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Eric Dumazet and committed by
David S. Miller
c609e6aa 9dc22c0d

+5 -1
+5 -1
include/net/sock.h
··· 934 934 WRITE_ONCE(sk->sk_ack_backlog, sk->sk_ack_backlog + 1); 935 935 } 936 936 937 + /* Note: If you think the test should be: 938 + * return READ_ONCE(sk->sk_ack_backlog) >= READ_ONCE(sk->sk_max_ack_backlog); 939 + * Then please take a look at commit 64a146513f8f ("[NET]: Revert incorrect accept queue backlog changes.") 940 + */ 937 941 static inline bool sk_acceptq_is_full(const struct sock *sk) 938 942 { 939 - return READ_ONCE(sk->sk_ack_backlog) >= READ_ONCE(sk->sk_max_ack_backlog); 943 + return READ_ONCE(sk->sk_ack_backlog) > READ_ONCE(sk->sk_max_ack_backlog); 940 944 } 941 945 942 946 /*