[PATCH AUTOSEL 5.10 09/33] net: correct sk_acceptq_is_full()

Subsystems: networking [general], networking [sockets], the rest

STALE1951d

3 messages, 2 authors, 2021-04-07 · open the first message on its own page

[PATCH AUTOSEL 5.10 09/33] net: correct sk_acceptq_is_full()

From: Sasha Levin <sashal@kernel.org>
Date: 2021-03-29 22:24:57

From: liuyacan <redacted>

[ Upstream commit f211ac154577ec9ccf07c15f18a6abf0d9bdb4ab ]

The "backlog" argument in listen() specifies
the maximom length of pending connections,
so the accept queue should be considered full
if there are exactly "backlog" elements.

Signed-off-by: liuyacan <redacted>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/net/sock.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/net/sock.h b/include/net/sock.h
index 253202dcc5e6..8cdc009d7636 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -930,7 +930,7 @@ static inline void sk_acceptq_added(struct sock *sk)
 
 static inline bool sk_acceptq_is_full(const struct sock *sk)
 {
-	return READ_ONCE(sk->sk_ack_backlog) > READ_ONCE(sk->sk_max_ack_backlog);
+	return READ_ONCE(sk->sk_ack_backlog) >= READ_ONCE(sk->sk_max_ack_backlog);
 }
 
 /*
-- 
2.30.1

Re: [PATCH AUTOSEL 5.10 09/33] net: correct sk_acceptq_is_full()

From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Date: 2021-04-05 18:59:13

On Mon, Mar 29, 2021 at 06:21:57PM -0400, Sasha Levin wrote:
From: liuyacan <redacted>

[ Upstream commit f211ac154577ec9ccf07c15f18a6abf0d9bdb4ab ]

The "backlog" argument in listen() specifies
the maximom length of pending connections,
so the accept queue should be considered full
if there are exactly "backlog" elements.
Hi Sasha. Can you please confirm that this one was dropped as well?
Thanks.

Re: [PATCH AUTOSEL 5.10 09/33] net: correct sk_acceptq_is_full()

From: Sasha Levin <sashal@kernel.org>
Date: 2021-04-07 14:15:22

On Mon, Apr 05, 2021 at 03:59:02PM -0300, Marcelo Ricardo Leitner wrote:
On Mon, Mar 29, 2021 at 06:21:57PM -0400, Sasha Levin wrote:
quoted
From: liuyacan <redacted>

[ Upstream commit f211ac154577ec9ccf07c15f18a6abf0d9bdb4ab ]

The "backlog" argument in listen() specifies
the maximom length of pending connections,
so the accept queue should be considered full
if there are exactly "backlog" elements.
Hi Sasha. Can you please confirm that this one was dropped as well?
Thanks.
Yup!

-- 
Thanks,
Sasha
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help