Skip to content

Commit 61e4a86

Browse files
dhowellskuba-moo
authored andcommitted
rxrpc: Fix two connection reaping bugs
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 <[email protected]> cc: Marc Dionne <[email protected]> cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 74da779 commit 61e4a86

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

net/rxrpc/conn_object.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ void rxrpc_disconnect_call(struct rxrpc_call *call)
212212
conn->idle_timestamp = jiffies;
213213
if (atomic_dec_and_test(&conn->active))
214214
rxrpc_set_service_reap_timer(conn->rxnet,
215-
jiffies + rxrpc_connection_expiry);
215+
jiffies + rxrpc_connection_expiry * HZ);
216216
}
217217

218218
rxrpc_put_call(call, rxrpc_call_put_io_thread);

net/rxrpc/local_object.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ static void rxrpc_client_conn_reap_timeout(struct timer_list *timer)
8787
struct rxrpc_local *local =
8888
container_of(timer, struct rxrpc_local, client_conn_reap_timer);
8989

90-
if (local->kill_all_client_conns &&
90+
if (!local->kill_all_client_conns &&
9191
test_and_set_bit(RXRPC_CLIENT_CONN_REAP_TIMER, &local->client_conn_flags))
9292
rxrpc_wake_up_io_thread(local);
9393
}

0 commit comments

Comments
 (0)