Skip to content

Commit

Permalink
rxrpc: Fix two connection reaping bugs
Browse files Browse the repository at this point in the history
Fix two connection reaping bugs:

 (1) rxrpc_connection_expiry is in units of seconds, so
     rxrpc_disconnect_call() needs to multiply it by HZ when adding it to
     jiffies.

 (2) rxrpc_client_conn_reap_timeout() should set RXRPC_CLIENT_REAP_TIMER if
     local->kill_all_client_conns is clear, not if it is set (in which case
     we don't need the timer).  Without this, old client connections don't
     get cleaned up until the local endpoint is cleaned up.

Fixes: 5040011 ("rxrpc: Make the local endpoint hold a ref on a connected call")
Fixes: 0d6bf31 ("rxrpc: Move the client conn cache management to the I/O thread")
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
Link: https://lore.kernel.org/r/783911.1698364174@warthog.procyon.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
dhowells authored and kuba-moo committed Nov 2, 2023
1 parent 74da779 commit 61e4a86
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion net/rxrpc/conn_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ void rxrpc_disconnect_call(struct rxrpc_call *call)
conn->idle_timestamp = jiffies;
if (atomic_dec_and_test(&conn->active))
rxrpc_set_service_reap_timer(conn->rxnet,
jiffies + rxrpc_connection_expiry);
jiffies + rxrpc_connection_expiry * HZ);
}

rxrpc_put_call(call, rxrpc_call_put_io_thread);
Expand Down
2 changes: 1 addition & 1 deletion net/rxrpc/local_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ static void rxrpc_client_conn_reap_timeout(struct timer_list *timer)
struct rxrpc_local *local =
container_of(timer, struct rxrpc_local, client_conn_reap_timer);

if (local->kill_all_client_conns &&
if (!local->kill_all_client_conns &&
test_and_set_bit(RXRPC_CLIENT_CONN_REAP_TIMER, &local->client_conn_flags))
rxrpc_wake_up_io_thread(local);
}
Expand Down

0 comments on commit 61e4a86

Please sign in to comment.