Skip to contentSkip to conversation

vsock/vmci: use sk_acceptq_is_full() helper

PATCH Superseded Raf Dickson 4 participants 6 messages Jun 11

Subsystems (5)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vsock/vmci: use sk_acceptq_is_full() helper

Replace the open-coded backlog check with sk_acceptq_is_full(). The helper uses > instead of >=, which is the correct comparison per commit 64a146513f8f ("[NET]: Revert incorrect accept queue backlog changes."), and adds READ_ONCE() for proper memory ordering.

---
 net/vmw_vsock/vmci_transport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/vmw_vsock/vmci_transport.c +1 -1
index 91516488a7..56503bee31 100644
@@ -1010,7 +1010,7 @@ static int vmci_transport_recv_listen(struct sock *sk,
 	 * reset.  Otherwise we create and initialize a child socket and reply
 	 * with a connection negotiation.
 	 */
-	if (sk->sk_ack_backlog >= sk->sk_max_ack_backlog) {
+	if (sk_acceptq_is_full(sk)) {
 		vmci_transport_reply_reset(pkt);
 		return -ECONNREFUSED;
 	}
Signature · 1 line
2.54.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Raf Dickson

Replace the open-coded backlog check with sk_acceptq_is_full(). The helper uses > instead of >=, which is the correct comparison per commit 64a146513f8f ("[NET]: Revert incorrect accept queue backlog changes."), and adds READ_ONCE() for proper memory ordering.

this blank line should be dropped

Quoted 21 lines

---
net/vmw_vsock/vmci_transport.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
net/vmw_vsock/vmci_transport.c +1 -1
index 91516488a7..56503bee31 100644
@@ -1010,7 +1010,7 @@ static int vmci_transport_recv_listen(struct sock *sk,
 	 * reset.  Otherwise we create and initialize a child socket and reply
 	 * with a connection negotiation.
 	 */
-	if (sk->sk_ack_backlog >= sk->sk_max_ack_backlog) {
+	if (sk_acceptq_is_full(sk)) {
 		vmci_transport_reply_reset(pkt);
 		return -ECONNREFUSED;
 	}
Signature · 1 line
2.54.0

Thanks for the patch!

note: according to patchwork [1] you forgot to CC some maintainers, please be more careful next time :)

[1] https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/

#2 lore raw
Quoted 6 lines · Luigi Leonardi

this blank line should be dropped

note: according to patchwork [1] you forgot to CC some maintainers, please be more careful next time :)

Thanks for the review! Fixed the blank line and will add the missing maintainers (horms, edumazet, kuba) in v2. Will send after the 24h window. Also tried get_maintainer.pl but it kept refusing to recognize the sparse checkout as a kernel tree -- lesson learned to check patchwork next time.

Raf

maintainer
#3 lore raw
In reply to Luigi Leonardi
Quoted 2 lines · On Thu, 11 Jun 2026 09:58:22 +0200 Luigi Leonardi wrote:

note: according to patchwork [1] you forgot to CC some maintainers, please be more careful next time :)

Please focus your reviews on the code not patchwork checks.

maintainer Reviewed-by on v1 1/1
#4 lore raw
In reply to Raf Dickson
Quoted 11 lines · Raf Dickson

Replace the open-coded backlog check with sk_acceptq_is_full(). The helper uses > instead of >=, which is the correct comparison per commit 64a146513f8f ("[NET]: Revert incorrect accept queue backlog changes."), and adds READ_ONCE() for proper memory ordering.

---
net/vmw_vsock/vmci_transport.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)

Thanks for this, what about fixing also hyperv_transport ?

Stefano

Quoted 17 lines
net/vmw_vsock/vmci_transport.c +1 -1
index 91516488a7..56503bee31 100644
@@ -1010,7 +1010,7 @@ static int vmci_transport_recv_listen(struct sock *sk,
 	 * reset.  Otherwise we create and initialize a child socket and reply
 	 * with a connection negotiation.
 	 */
-	if (sk->sk_ack_backlog >= sk->sk_max_ack_backlog) {
+	if (sk_acceptq_is_full(sk)) {
 		vmci_transport_reply_reset(pkt);
 		return -ECONNREFUSED;
 	}
Signature · 1 line
2.54.0
#5 lore raw
Quoted 1 line · Stefano Garzarella

Thanks for this, what about fixing also hyperv_transport ?

nice spotting, hyperv_transport.c:326 has the same open-coded check. Will include it in v2 of this patch.

Raf