]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
vsock: use sk_acceptq_is_full() helper in all transports
authorRaf Dickson <rafdog35@gmail.com>
Fri, 12 Jun 2026 04:58:42 +0000 (04:58 +0000)
committerJakub Kicinski <kuba@kernel.org>
Sat, 13 Jun 2026 17:36:37 +0000 (10:36 -0700)
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.

Suggested-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Raf Dickson <rafdog35@gmail.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Luigi Leonardi <leonardi@redhat.com>
Link: https://patch.msgid.link/20260612045842.122207-1-rafdog35@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/vmw_vsock/hyperv_transport.c
net/vmw_vsock/vmci_transport.c

index b3394946b2ed7c131e76102c1bb986ea5ccf91ad..e6adbc47011da8fac0f892e464ba02c1724337f4 100644 (file)
@@ -323,7 +323,7 @@ static void hvs_open_connection(struct vmbus_channel *chan)
                goto out;
 
        if (conn_from_host) {
-               if (sk->sk_ack_backlog >= sk->sk_max_ack_backlog)
+               if (sk_acceptq_is_full(sk))
                        goto out;
 
                new = vsock_create_connected(sk);
index 91516488a742ad63ebe6ef9bc58f947acd304695..56503bee3165bf0cb35efbc1615d2e34e3daa2c5 100644 (file)
@@ -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;
        }