• David Howells's avatar
    rxrpc: Fix the putting of client connections · 66d58af7
    David Howells authored
    In rxrpc_put_one_client_conn(), if a connection has RXRPC_CONN_COUNTED set
    on it, then it's accounted for in rxrpc_nr_client_conns and may be on
    various lists - and this is cleaned up correctly.
    
    However, if the connection doesn't have RXRPC_CONN_COUNTED set on it, then
    the put routine returns rather than just skipping the extra bit of cleanup.
    
    Fix this by making the extra bit of clean up conditional instead and always
    killing off the connection.
    
    This manifests itself as connections with a zero usage count hanging around
    in /proc/net/rxrpc_conns because the connection allocated, but discarded,
    due to a race with another process that set up a parallel connection, which
    was then shared instead.
    Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
    66d58af7
conn_client.c 29 KB