Skip to content

Commit c609e6a

Browse files
Eric Dumazetdavem330
authored andcommitted
Revert "net: correct sk_acceptq_is_full()"
This reverts commit f211ac1. We had similar attempt in the past, and we reverted it. History: 64a1465 [NET]: Revert incorrect accept queue backlog changes. 8488df8 [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: f211ac1 ("net: correct sk_acceptq_is_full()") Cc: iuyacan <[email protected]> Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9dc22c0 commit c609e6a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

include/net/sock.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,9 +934,13 @@ static inline void sk_acceptq_added(struct sock *sk)
934934
WRITE_ONCE(sk->sk_ack_backlog, sk->sk_ack_backlog + 1);
935935
}
936936

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+
*/
937941
static inline bool sk_acceptq_is_full(const struct sock *sk)
938942
{
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);
940944
}
941945

942946
/*

0 commit comments

Comments
 (0)