tcp/dccp: complete lockless accesses to sk->sk_max_ack_backlog
authorJason Xing <kernelxing@tencent.com>
Sun, 31 Mar 2024 09:05:21 +0000 (17:05 +0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 3 Apr 2024 01:21:13 +0000 (18:21 -0700)
Since commit 099ecf59f05b ("net: annotate lockless accesses to
sk->sk_max_ack_backlog") decided to handle the sk_max_ack_backlog
locklessly, there is one more function mostly called in TCP/DCCP
cases. So this patch completes it:)

Signed-off-by: Jason Xing <kernelxing@tencent.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20240331090521.71965-1-kerneljasonxing@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/inet_connection_sock.h

index d96c871b0d581b06c660317f195094d5b2733614..20e7b0c0b3d1232fa626e3b4ba97af958ae4be95 100644 (file)
@@ -281,7 +281,7 @@ static inline int inet_csk_reqsk_queue_len(const struct sock *sk)
 
 static inline int inet_csk_reqsk_queue_is_full(const struct sock *sk)
 {
-       return inet_csk_reqsk_queue_len(sk) >= sk->sk_max_ack_backlog;
+       return inet_csk_reqsk_queue_len(sk) >= READ_ONCE(sk->sk_max_ack_backlog);
 }
 
 bool inet_csk_reqsk_queue_drop(struct sock *sk, struct request_sock *req);