diff options
author | David Howells <dhowells@redhat.com> | 2016-06-27 18:11:19 +0200 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2016-07-06 11:43:51 +0200 |
commit | dee46364ce6fd0815ad9da625783eda21ccf7b06 (patch) | |
tree | 1d4b7d3d3aa9198475f272bbc2ce8be81368b9ad /net/rxrpc/local_object.c | |
parent | rxrpc: Release a call's connection ref on call disconnection (diff) | |
download | linux-dee46364ce6fd0815ad9da625783eda21ccf7b06.tar.xz linux-dee46364ce6fd0815ad9da625783eda21ccf7b06.zip |
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>
Diffstat (limited to 'net/rxrpc/local_object.c')
-rw-r--r-- | net/rxrpc/local_object.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/net/rxrpc/local_object.c b/net/rxrpc/local_object.c index 3ab7764f7cd8..a753796fbe8f 100644 --- a/net/rxrpc/local_object.c +++ b/net/rxrpc/local_object.c @@ -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(); } |