summaryrefslogtreecommitdiff
path: root/net/rxrpc/peer_object.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2016-04-04 16:00:34 +0300
committerDavid Howells <dhowells@redhat.com>2016-06-15 12:15:16 +0300
commitf66d7490196055cb9fb058f8936d19111a6231b9 (patch)
tree915553b7124caf0a18c22db24e2ee1c60cafcc96 /net/rxrpc/peer_object.c
parentfe77d5fc5ab33bb088cf8448767a77fdc32e08d1 (diff)
downloadlinux-f66d7490196055cb9fb058f8936d19111a6231b9.tar.xz
rxrpc: Use the peer record to distribute network errors
Use the peer record to distribute network errors rather than the transport object (which I want to get rid of). An error from a particular peer terminates all calls on that peer. For future consideration: (1) For ICMP-induced errors it might be worth trying to extract the RxRPC header from the offending packet, if one is returned attached to the ICMP packet, to better direct the error. This may be overkill, though, since an ICMP packet would be expected to be relating to the destination port, machine or network. RxRPC ABORT and BUSY packets give notice at RxRPC level. (2) To also abort connection-level communications (such as CHALLENGE packets) where indicted by an error - but that requires some revamping of the connection event handling first. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'net/rxrpc/peer_object.c')
-rw-r--r--net/rxrpc/peer_object.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/rxrpc/peer_object.c b/net/rxrpc/peer_object.c
index 7fc50dc7d333..faf222c21698 100644
--- a/net/rxrpc/peer_object.c
+++ b/net/rxrpc/peer_object.c
@@ -182,7 +182,9 @@ struct rxrpc_peer *rxrpc_alloc_peer(struct rxrpc_local *local, gfp_t gfp)
if (peer) {
atomic_set(&peer->usage, 1);
peer->local = local;
- INIT_LIST_HEAD(&peer->error_targets);
+ INIT_HLIST_HEAD(&peer->error_targets);
+ INIT_WORK(&peer->error_distributor,
+ &rxrpc_peer_error_distributor);
spin_lock_init(&peer->lock);
peer->debug_id = atomic_inc_return(&rxrpc_debug_id);
}
@@ -298,7 +300,7 @@ struct rxrpc_peer *rxrpc_lookup_peer(struct rxrpc_local *local,
*/
void __rxrpc_put_peer(struct rxrpc_peer *peer)
{
- ASSERT(list_empty(&peer->error_targets));
+ ASSERT(hlist_empty(&peer->error_targets));
spin_lock(&rxrpc_peer_hash_lock);
hash_del_rcu(&peer->hash_link);