rxrpc: Fix two connection reaping bugs
Subsystems (3)
David Howells
maintainerPATCH 1/1 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.
--- net/rxrpc/conn_object.c | 2 +- net/rxrpc/local_object.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
net/rxrpc/conn_object.c +1 -1
@@ -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);
net/rxrpc/local_object.c +1 -1
@@ -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); }
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 6 lines · On Fri, 27 Oct 2023 00:49:34 +0100 you wrote:
Fix two connection reaping bugs:
(1)
rxrpc_connection_expiryis in units of seconds, sorxrpc_disconnect_call()needs to multiply it by HZ when adding it to jiffies.
Quoted 6 lines
(2)
rxrpc_client_conn_reap_timeout()should setRXRPC_CLIENT_REAP_TIMERiflocal->kill_all_client_connsis 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.[...]
Here is the summary with links:
- [net] rxrpc: Fix two connection reaping bugs
https://git.kernel.org/netdev/net/c/61e4a8660002
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html