rxrpc: Add RCU destruction for connections and calls
Add RCU destruction for connections and calls as the RCU lookup from the transport socket data_ready handler is going to come along shortly. Whilst we're at it, move the cleanup workqueue flushing and RCU barrierage into the destruction code for the objects that need it (locals and connections) and add the extra RCU barrier required for connection cleanup. Signed-off-by: David Howells <dhowells@redhat.com>
This commit is contained in:
@@ -374,14 +374,17 @@ void __exit rxrpc_destroy_all_locals(void)
|
||||
|
||||
_enter("");
|
||||
|
||||
if (list_empty(&rxrpc_local_endpoints))
|
||||
return;
|
||||
flush_workqueue(rxrpc_workqueue);
|
||||
|
||||
mutex_lock(&rxrpc_local_mutex);
|
||||
list_for_each_entry(local, &rxrpc_local_endpoints, link) {
|
||||
pr_err("AF_RXRPC: Leaked local %p {%d}\n",
|
||||
local, atomic_read(&local->usage));
|
||||
if (!list_empty(&rxrpc_local_endpoints)) {
|
||||
mutex_lock(&rxrpc_local_mutex);
|
||||
list_for_each_entry(local, &rxrpc_local_endpoints, link) {
|
||||
pr_err("AF_RXRPC: Leaked local %p {%d}\n",
|
||||
local, atomic_read(&local->usage));
|
||||
}
|
||||
mutex_unlock(&rxrpc_local_mutex);
|
||||
BUG();
|
||||
}
|
||||
mutex_unlock(&rxrpc_local_mutex);
|
||||
BUG();
|
||||
|
||||
rcu_barrier();
|
||||
}
|
||||
|
Reference in New Issue
Block a user