David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 1 | /* RxRPC virtual connection handler |
| 2 | * |
| 3 | * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. |
| 4 | * Written by David Howells (dhowells@redhat.com) |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License |
| 8 | * as published by the Free Software Foundation; either version |
| 9 | * 2 of the License, or (at your option) any later version. |
| 10 | */ |
| 11 | |
Joe Perches | 9b6d539 | 2016-06-02 12:08:52 -0700 | [diff] [blame] | 12 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
| 13 | |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 14 | #include <linux/module.h> |
Tejun Heo | 5a0e3ad | 2010-03-24 17:04:11 +0900 | [diff] [blame] | 15 | #include <linux/slab.h> |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 16 | #include <linux/net.h> |
| 17 | #include <linux/skbuff.h> |
| 18 | #include <linux/crypto.h> |
| 19 | #include <net/sock.h> |
| 20 | #include <net/af_rxrpc.h> |
| 21 | #include "ar-internal.h" |
| 22 | |
David Howells | 5873c08 | 2014-02-07 18:58:44 +0000 | [diff] [blame] | 23 | /* |
| 24 | * Time till a connection expires after last use (in seconds). |
| 25 | */ |
David Howells | dad8aff | 2016-03-09 23:22:56 +0000 | [diff] [blame] | 26 | unsigned int rxrpc_connection_expiry = 10 * 60; |
David Howells | 5873c08 | 2014-02-07 18:58:44 +0000 | [diff] [blame] | 27 | |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 28 | static void rxrpc_connection_reaper(struct work_struct *work); |
| 29 | |
| 30 | LIST_HEAD(rxrpc_connections); |
| 31 | DEFINE_RWLOCK(rxrpc_connection_lock); |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 32 | static DECLARE_DELAYED_WORK(rxrpc_connection_reap, rxrpc_connection_reaper); |
| 33 | |
| 34 | /* |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 35 | * allocate a new connection |
| 36 | */ |
David Howells | c6d2b8d | 2016-04-04 14:00:40 +0100 | [diff] [blame] | 37 | struct rxrpc_connection *rxrpc_alloc_connection(gfp_t gfp) |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 38 | { |
| 39 | struct rxrpc_connection *conn; |
| 40 | |
| 41 | _enter(""); |
| 42 | |
| 43 | conn = kzalloc(sizeof(struct rxrpc_connection), gfp); |
| 44 | if (conn) { |
David Howells | 999b69f | 2016-06-17 15:42:35 +0100 | [diff] [blame] | 45 | spin_lock_init(&conn->channel_lock); |
| 46 | init_waitqueue_head(&conn->channel_wq); |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 47 | INIT_WORK(&conn->processor, &rxrpc_process_connection); |
David Howells | 999b69f | 2016-06-17 15:42:35 +0100 | [diff] [blame] | 48 | INIT_LIST_HEAD(&conn->link); |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 49 | skb_queue_head_init(&conn->rx_queue); |
David Howells | e0e4d82 | 2016-04-07 17:23:58 +0100 | [diff] [blame] | 50 | conn->security = &rxrpc_no_security; |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 51 | spin_lock_init(&conn->state_lock); |
| 52 | atomic_set(&conn->usage, 1); |
| 53 | conn->debug_id = atomic_inc_return(&rxrpc_debug_id); |
David Howells | 999b69f | 2016-06-17 15:42:35 +0100 | [diff] [blame] | 54 | atomic_set(&conn->avail_chans, RXRPC_MAXCALLS); |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 55 | conn->size_align = 4; |
David Howells | 0d12f8a | 2016-03-04 15:53:46 +0000 | [diff] [blame] | 56 | conn->header_size = sizeof(struct rxrpc_wire_header); |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 57 | } |
| 58 | |
Adrian Bunk | 16c61ad | 2007-06-15 15:15:43 -0700 | [diff] [blame] | 59 | _leave(" = %p{%d}", conn, conn ? conn->debug_id : 0); |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 60 | return conn; |
| 61 | } |
| 62 | |
| 63 | /* |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 64 | * find a connection based on transport and RxRPC connection ID for an incoming |
| 65 | * packet |
| 66 | */ |
David Howells | aa390bb | 2016-06-17 10:06:56 +0100 | [diff] [blame] | 67 | struct rxrpc_connection *rxrpc_find_connection(struct rxrpc_local *local, |
| 68 | struct rxrpc_peer *peer, |
David Howells | 42886ff | 2016-06-16 13:31:07 +0100 | [diff] [blame] | 69 | struct sk_buff *skb) |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 70 | { |
| 71 | struct rxrpc_connection *conn; |
David Howells | 42886ff | 2016-06-16 13:31:07 +0100 | [diff] [blame] | 72 | struct rxrpc_skb_priv *sp = rxrpc_skb(skb); |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 73 | struct rb_node *p; |
David Howells | 0d12f8a | 2016-03-04 15:53:46 +0000 | [diff] [blame] | 74 | u32 epoch, cid; |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 75 | |
David Howells | 42886ff | 2016-06-16 13:31:07 +0100 | [diff] [blame] | 76 | _enter(",{%x,%x}", sp->hdr.cid, sp->hdr.flags); |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 77 | |
David Howells | aa390bb | 2016-06-17 10:06:56 +0100 | [diff] [blame] | 78 | read_lock_bh(&peer->conn_lock); |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 79 | |
David Howells | 42886ff | 2016-06-16 13:31:07 +0100 | [diff] [blame] | 80 | cid = sp->hdr.cid & RXRPC_CIDMASK; |
| 81 | epoch = sp->hdr.epoch; |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 82 | |
David Howells | 4a3388c | 2016-04-04 14:00:37 +0100 | [diff] [blame] | 83 | if (sp->hdr.flags & RXRPC_CLIENT_INITIATED) { |
David Howells | aa390bb | 2016-06-17 10:06:56 +0100 | [diff] [blame] | 84 | p = peer->service_conns.rb_node; |
David Howells | 4a3388c | 2016-04-04 14:00:37 +0100 | [diff] [blame] | 85 | while (p) { |
David Howells | 999b69f | 2016-06-17 15:42:35 +0100 | [diff] [blame] | 86 | conn = rb_entry(p, struct rxrpc_connection, service_node); |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 87 | |
David Howells | 4a3388c | 2016-04-04 14:00:37 +0100 | [diff] [blame] | 88 | _debug("maybe %x", conn->proto.cid); |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 89 | |
David Howells | 4a3388c | 2016-04-04 14:00:37 +0100 | [diff] [blame] | 90 | if (epoch < conn->proto.epoch) |
| 91 | p = p->rb_left; |
| 92 | else if (epoch > conn->proto.epoch) |
| 93 | p = p->rb_right; |
| 94 | else if (cid < conn->proto.cid) |
| 95 | p = p->rb_left; |
| 96 | else if (cid > conn->proto.cid) |
| 97 | p = p->rb_right; |
| 98 | else |
| 99 | goto found; |
| 100 | } |
| 101 | } else { |
| 102 | conn = idr_find(&rxrpc_client_conn_ids, cid >> RXRPC_CIDSHIFT); |
David Howells | 689f4c6 | 2016-06-30 11:34:30 +0100 | [diff] [blame] | 103 | if (conn && |
| 104 | conn->proto.epoch == epoch && |
| 105 | conn->params.peer == peer) |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 106 | goto found; |
| 107 | } |
| 108 | |
David Howells | aa390bb | 2016-06-17 10:06:56 +0100 | [diff] [blame] | 109 | read_unlock_bh(&peer->conn_lock); |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 110 | _leave(" = NULL"); |
| 111 | return NULL; |
| 112 | |
| 113 | found: |
David Howells | 5627cc8 | 2016-04-04 14:00:38 +0100 | [diff] [blame] | 114 | rxrpc_get_connection(conn); |
David Howells | aa390bb | 2016-06-17 10:06:56 +0100 | [diff] [blame] | 115 | read_unlock_bh(&peer->conn_lock); |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 116 | _leave(" = %p", conn); |
| 117 | return conn; |
| 118 | } |
| 119 | |
| 120 | /* |
David Howells | 999b69f | 2016-06-17 15:42:35 +0100 | [diff] [blame] | 121 | * Disconnect a call and clear any channel it occupies when that call |
David Howells | a1399f8 | 2016-06-27 14:39:44 +0100 | [diff] [blame] | 122 | * terminates. The caller must hold the channel_lock and must release the |
| 123 | * call's ref on the connection. |
| 124 | */ |
| 125 | void __rxrpc_disconnect_call(struct rxrpc_call *call) |
| 126 | { |
| 127 | struct rxrpc_connection *conn = call->conn; |
| 128 | struct rxrpc_channel *chan = &conn->channels[call->channel]; |
| 129 | |
| 130 | _enter("%d,%d", conn->debug_id, call->channel); |
| 131 | |
| 132 | if (rcu_access_pointer(chan->call) == call) { |
| 133 | /* Save the result of the call so that we can repeat it if necessary |
| 134 | * through the channel, whilst disposing of the actual call record. |
| 135 | */ |
| 136 | chan->last_result = call->local_abort; |
| 137 | smp_wmb(); |
| 138 | chan->last_call = chan->call_id; |
| 139 | chan->call_id = chan->call_counter; |
| 140 | |
| 141 | rcu_assign_pointer(chan->call, NULL); |
| 142 | atomic_inc(&conn->avail_chans); |
| 143 | wake_up(&conn->channel_wq); |
| 144 | } |
| 145 | |
| 146 | _leave(""); |
| 147 | } |
| 148 | |
| 149 | /* |
| 150 | * Disconnect a call and clear any channel it occupies when that call |
David Howells | 999b69f | 2016-06-17 15:42:35 +0100 | [diff] [blame] | 151 | * terminates. |
| 152 | */ |
| 153 | void rxrpc_disconnect_call(struct rxrpc_call *call) |
| 154 | { |
| 155 | struct rxrpc_connection *conn = call->conn; |
David Howells | 999b69f | 2016-06-17 15:42:35 +0100 | [diff] [blame] | 156 | |
David Howells | e653cfe | 2016-04-04 14:00:38 +0100 | [diff] [blame] | 157 | spin_lock(&conn->channel_lock); |
David Howells | a1399f8 | 2016-06-27 14:39:44 +0100 | [diff] [blame] | 158 | __rxrpc_disconnect_call(call); |
David Howells | e653cfe | 2016-04-04 14:00:38 +0100 | [diff] [blame] | 159 | spin_unlock(&conn->channel_lock); |
| 160 | |
| 161 | call->conn = NULL; |
| 162 | rxrpc_put_connection(conn); |
David Howells | 999b69f | 2016-06-17 15:42:35 +0100 | [diff] [blame] | 163 | } |
| 164 | |
| 165 | /* |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 166 | * release a virtual connection |
| 167 | */ |
| 168 | void rxrpc_put_connection(struct rxrpc_connection *conn) |
| 169 | { |
David Howells | 999b69f | 2016-06-17 15:42:35 +0100 | [diff] [blame] | 170 | if (!conn) |
| 171 | return; |
| 172 | |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 173 | _enter("%p{u=%d,d=%d}", |
| 174 | conn, atomic_read(&conn->usage), conn->debug_id); |
| 175 | |
| 176 | ASSERTCMP(atomic_read(&conn->usage), >, 0); |
| 177 | |
Ksenija Stanojevic | 22a3f9a | 2015-09-17 18:12:53 +0200 | [diff] [blame] | 178 | conn->put_time = ktime_get_seconds(); |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 179 | if (atomic_dec_and_test(&conn->usage)) { |
| 180 | _debug("zombie"); |
David Howells | 651350d | 2007-04-26 15:50:17 -0700 | [diff] [blame] | 181 | rxrpc_queue_delayed_work(&rxrpc_connection_reap, 0); |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 182 | } |
| 183 | |
| 184 | _leave(""); |
| 185 | } |
| 186 | |
| 187 | /* |
| 188 | * destroy a virtual connection |
| 189 | */ |
David Howells | dee4636 | 2016-06-27 17:11:19 +0100 | [diff] [blame] | 190 | static void rxrpc_destroy_connection(struct rcu_head *rcu) |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 191 | { |
David Howells | dee4636 | 2016-06-27 17:11:19 +0100 | [diff] [blame] | 192 | struct rxrpc_connection *conn = |
| 193 | container_of(rcu, struct rxrpc_connection, rcu); |
| 194 | |
| 195 | _enter("{%d,u=%d}", conn->debug_id, atomic_read(&conn->usage)); |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 196 | |
| 197 | ASSERTCMP(atomic_read(&conn->usage), ==, 0); |
| 198 | |
| 199 | _net("DESTROY CONN %d", conn->debug_id); |
| 200 | |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 201 | rxrpc_purge_queue(&conn->rx_queue); |
| 202 | |
David Howells | e0e4d82 | 2016-04-07 17:23:58 +0100 | [diff] [blame] | 203 | conn->security->clear(conn); |
David Howells | 19ffa01 | 2016-04-04 14:00:36 +0100 | [diff] [blame] | 204 | key_put(conn->params.key); |
David Howells | e0e4d82 | 2016-04-07 17:23:58 +0100 | [diff] [blame] | 205 | key_put(conn->server_key); |
David Howells | aa390bb | 2016-06-17 10:06:56 +0100 | [diff] [blame] | 206 | rxrpc_put_peer(conn->params.peer); |
| 207 | rxrpc_put_local(conn->params.local); |
David Howells | e0e4d82 | 2016-04-07 17:23:58 +0100 | [diff] [blame] | 208 | |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 209 | kfree(conn); |
| 210 | _leave(""); |
| 211 | } |
| 212 | |
| 213 | /* |
| 214 | * reap dead connections |
| 215 | */ |
Roel Kluin | 5eaa65b | 2008-12-10 15:18:31 -0800 | [diff] [blame] | 216 | static void rxrpc_connection_reaper(struct work_struct *work) |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 217 | { |
| 218 | struct rxrpc_connection *conn, *_p; |
David Howells | aa390bb | 2016-06-17 10:06:56 +0100 | [diff] [blame] | 219 | struct rxrpc_peer *peer; |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 220 | unsigned long now, earliest, reap_time; |
| 221 | |
| 222 | LIST_HEAD(graveyard); |
| 223 | |
| 224 | _enter(""); |
| 225 | |
Ksenija Stanojevic | 22a3f9a | 2015-09-17 18:12:53 +0200 | [diff] [blame] | 226 | now = ktime_get_seconds(); |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 227 | earliest = ULONG_MAX; |
| 228 | |
David Howells | b3f5750 | 2016-06-21 16:10:03 +0100 | [diff] [blame] | 229 | write_lock(&rxrpc_connection_lock); |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 230 | list_for_each_entry_safe(conn, _p, &rxrpc_connections, link) { |
| 231 | _debug("reap CONN %d { u=%d,t=%ld }", |
| 232 | conn->debug_id, atomic_read(&conn->usage), |
| 233 | (long) now - (long) conn->put_time); |
| 234 | |
| 235 | if (likely(atomic_read(&conn->usage) > 0)) |
| 236 | continue; |
| 237 | |
David Howells | 999b69f | 2016-06-17 15:42:35 +0100 | [diff] [blame] | 238 | if (rxrpc_conn_is_client(conn)) { |
| 239 | struct rxrpc_local *local = conn->params.local; |
| 240 | spin_lock(&local->client_conns_lock); |
| 241 | reap_time = conn->put_time + rxrpc_connection_expiry; |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 242 | |
David Howells | 999b69f | 2016-06-17 15:42:35 +0100 | [diff] [blame] | 243 | if (atomic_read(&conn->usage) > 0) { |
| 244 | ; |
| 245 | } else if (reap_time <= now) { |
| 246 | list_move_tail(&conn->link, &graveyard); |
David Howells | 4a3388c | 2016-04-04 14:00:37 +0100 | [diff] [blame] | 247 | rxrpc_put_client_connection_id(conn); |
David Howells | 999b69f | 2016-06-17 15:42:35 +0100 | [diff] [blame] | 248 | rb_erase(&conn->client_node, |
| 249 | &local->client_conns); |
| 250 | } else if (reap_time < earliest) { |
| 251 | earliest = reap_time; |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 252 | } |
| 253 | |
David Howells | 999b69f | 2016-06-17 15:42:35 +0100 | [diff] [blame] | 254 | spin_unlock(&local->client_conns_lock); |
| 255 | } else { |
David Howells | aa390bb | 2016-06-17 10:06:56 +0100 | [diff] [blame] | 256 | peer = conn->params.peer; |
| 257 | write_lock_bh(&peer->conn_lock); |
David Howells | 999b69f | 2016-06-17 15:42:35 +0100 | [diff] [blame] | 258 | reap_time = conn->put_time + rxrpc_connection_expiry; |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 259 | |
David Howells | 999b69f | 2016-06-17 15:42:35 +0100 | [diff] [blame] | 260 | if (atomic_read(&conn->usage) > 0) { |
| 261 | ; |
| 262 | } else if (reap_time <= now) { |
| 263 | list_move_tail(&conn->link, &graveyard); |
| 264 | rb_erase(&conn->service_node, |
David Howells | aa390bb | 2016-06-17 10:06:56 +0100 | [diff] [blame] | 265 | &peer->service_conns); |
David Howells | 999b69f | 2016-06-17 15:42:35 +0100 | [diff] [blame] | 266 | } else if (reap_time < earliest) { |
| 267 | earliest = reap_time; |
| 268 | } |
| 269 | |
David Howells | aa390bb | 2016-06-17 10:06:56 +0100 | [diff] [blame] | 270 | write_unlock_bh(&peer->conn_lock); |
David Howells | 999b69f | 2016-06-17 15:42:35 +0100 | [diff] [blame] | 271 | } |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 272 | } |
David Howells | b3f5750 | 2016-06-21 16:10:03 +0100 | [diff] [blame] | 273 | write_unlock(&rxrpc_connection_lock); |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 274 | |
| 275 | if (earliest != ULONG_MAX) { |
| 276 | _debug("reschedule reaper %ld", (long) earliest - now); |
| 277 | ASSERTCMP(earliest, >, now); |
David Howells | 651350d | 2007-04-26 15:50:17 -0700 | [diff] [blame] | 278 | rxrpc_queue_delayed_work(&rxrpc_connection_reap, |
| 279 | (earliest - now) * HZ); |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 280 | } |
| 281 | |
| 282 | /* then destroy all those pulled out */ |
| 283 | while (!list_empty(&graveyard)) { |
| 284 | conn = list_entry(graveyard.next, struct rxrpc_connection, |
| 285 | link); |
| 286 | list_del_init(&conn->link); |
| 287 | |
| 288 | ASSERTCMP(atomic_read(&conn->usage), ==, 0); |
David Howells | dee4636 | 2016-06-27 17:11:19 +0100 | [diff] [blame] | 289 | skb_queue_purge(&conn->rx_queue); |
| 290 | call_rcu(&conn->rcu, rxrpc_destroy_connection); |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 291 | } |
| 292 | |
| 293 | _leave(""); |
| 294 | } |
| 295 | |
| 296 | /* |
| 297 | * preemptively destroy all the connection records rather than waiting for them |
| 298 | * to time out |
| 299 | */ |
| 300 | void __exit rxrpc_destroy_all_connections(void) |
| 301 | { |
David Howells | dee4636 | 2016-06-27 17:11:19 +0100 | [diff] [blame] | 302 | struct rxrpc_connection *conn, *_p; |
| 303 | bool leak = false; |
| 304 | |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 305 | _enter(""); |
| 306 | |
David Howells | 5873c08 | 2014-02-07 18:58:44 +0000 | [diff] [blame] | 307 | rxrpc_connection_expiry = 0; |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 308 | cancel_delayed_work(&rxrpc_connection_reap); |
David Howells | 651350d | 2007-04-26 15:50:17 -0700 | [diff] [blame] | 309 | rxrpc_queue_delayed_work(&rxrpc_connection_reap, 0); |
David Howells | dee4636 | 2016-06-27 17:11:19 +0100 | [diff] [blame] | 310 | flush_workqueue(rxrpc_workqueue); |
| 311 | |
| 312 | write_lock(&rxrpc_connection_lock); |
| 313 | list_for_each_entry_safe(conn, _p, &rxrpc_connections, link) { |
| 314 | pr_err("AF_RXRPC: Leaked conn %p {%d}\n", |
| 315 | conn, atomic_read(&conn->usage)); |
| 316 | leak = true; |
| 317 | } |
| 318 | write_unlock(&rxrpc_connection_lock); |
| 319 | BUG_ON(leak); |
| 320 | |
| 321 | /* Make sure the local and peer records pinned by any dying connections |
| 322 | * are released. |
| 323 | */ |
| 324 | rcu_barrier(); |
| 325 | rxrpc_destroy_client_conn_ids(); |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 326 | |
| 327 | _leave(""); |
| 328 | } |