call_accept.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  1. /* incoming call handling
  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. #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
  12. #include <linux/module.h>
  13. #include <linux/net.h>
  14. #include <linux/skbuff.h>
  15. #include <linux/errqueue.h>
  16. #include <linux/udp.h>
  17. #include <linux/in.h>
  18. #include <linux/in6.h>
  19. #include <linux/icmp.h>
  20. #include <linux/gfp.h>
  21. #include <linux/circ_buf.h>
  22. #include <net/sock.h>
  23. #include <net/af_rxrpc.h>
  24. #include <net/ip.h>
  25. #include "ar-internal.h"
  26. /*
  27. * Preallocate a single service call, connection and peer and, if possible,
  28. * give them a user ID and attach the user's side of the ID to them.
  29. */
  30. static int rxrpc_service_prealloc_one(struct rxrpc_sock *rx,
  31. struct rxrpc_backlog *b,
  32. rxrpc_notify_rx_t notify_rx,
  33. rxrpc_user_attach_call_t user_attach_call,
  34. unsigned long user_call_ID, gfp_t gfp)
  35. {
  36. const void *here = __builtin_return_address(0);
  37. struct rxrpc_call *call;
  38. int max, tmp;
  39. unsigned int size = RXRPC_BACKLOG_MAX;
  40. unsigned int head, tail, call_head, call_tail;
  41. max = rx->sk.sk_max_ack_backlog;
  42. tmp = rx->sk.sk_ack_backlog;
  43. if (tmp >= max) {
  44. _leave(" = -ENOBUFS [full %u]", max);
  45. return -ENOBUFS;
  46. }
  47. max -= tmp;
  48. /* We don't need more conns and peers than we have calls, but on the
  49. * other hand, we shouldn't ever use more peers than conns or conns
  50. * than calls.
  51. */
  52. call_head = b->call_backlog_head;
  53. call_tail = READ_ONCE(b->call_backlog_tail);
  54. tmp = CIRC_CNT(call_head, call_tail, size);
  55. if (tmp >= max) {
  56. _leave(" = -ENOBUFS [enough %u]", tmp);
  57. return -ENOBUFS;
  58. }
  59. max = tmp + 1;
  60. head = b->peer_backlog_head;
  61. tail = READ_ONCE(b->peer_backlog_tail);
  62. if (CIRC_CNT(head, tail, size) < max) {
  63. struct rxrpc_peer *peer = rxrpc_alloc_peer(rx->local, gfp);
  64. if (!peer)
  65. return -ENOMEM;
  66. b->peer_backlog[head] = peer;
  67. smp_store_release(&b->peer_backlog_head,
  68. (head + 1) & (size - 1));
  69. }
  70. head = b->conn_backlog_head;
  71. tail = READ_ONCE(b->conn_backlog_tail);
  72. if (CIRC_CNT(head, tail, size) < max) {
  73. struct rxrpc_connection *conn;
  74. conn = rxrpc_prealloc_service_connection(gfp);
  75. if (!conn)
  76. return -ENOMEM;
  77. b->conn_backlog[head] = conn;
  78. smp_store_release(&b->conn_backlog_head,
  79. (head + 1) & (size - 1));
  80. trace_rxrpc_conn(conn, rxrpc_conn_new_service,
  81. atomic_read(&conn->usage), here);
  82. }
  83. /* Now it gets complicated, because calls get registered with the
  84. * socket here, particularly if a user ID is preassigned by the user.
  85. */
  86. call = rxrpc_alloc_call(gfp);
  87. if (!call)
  88. return -ENOMEM;
  89. call->flags |= (1 << RXRPC_CALL_IS_SERVICE);
  90. call->state = RXRPC_CALL_SERVER_PREALLOC;
  91. trace_rxrpc_call(call, rxrpc_call_new_service,
  92. atomic_read(&call->usage),
  93. here, (const void *)user_call_ID);
  94. write_lock(&rx->call_lock);
  95. if (user_attach_call) {
  96. struct rxrpc_call *xcall;
  97. struct rb_node *parent, **pp;
  98. /* Check the user ID isn't already in use */
  99. pp = &rx->calls.rb_node;
  100. parent = NULL;
  101. while (*pp) {
  102. parent = *pp;
  103. xcall = rb_entry(parent, struct rxrpc_call, sock_node);
  104. if (user_call_ID < call->user_call_ID)
  105. pp = &(*pp)->rb_left;
  106. else if (user_call_ID > call->user_call_ID)
  107. pp = &(*pp)->rb_right;
  108. else
  109. goto id_in_use;
  110. }
  111. call->user_call_ID = user_call_ID;
  112. call->notify_rx = notify_rx;
  113. rxrpc_get_call(call, rxrpc_call_got_kernel);
  114. user_attach_call(call, user_call_ID);
  115. rxrpc_get_call(call, rxrpc_call_got_userid);
  116. rb_link_node(&call->sock_node, parent, pp);
  117. rb_insert_color(&call->sock_node, &rx->calls);
  118. set_bit(RXRPC_CALL_HAS_USERID, &call->flags);
  119. }
  120. list_add(&call->sock_link, &rx->sock_calls);
  121. write_unlock(&rx->call_lock);
  122. write_lock(&rxrpc_call_lock);
  123. list_add_tail(&call->link, &rxrpc_calls);
  124. write_unlock(&rxrpc_call_lock);
  125. b->call_backlog[call_head] = call;
  126. smp_store_release(&b->call_backlog_head, (call_head + 1) & (size - 1));
  127. _leave(" = 0 [%d -> %lx]", call->debug_id, user_call_ID);
  128. return 0;
  129. id_in_use:
  130. write_unlock(&rx->call_lock);
  131. rxrpc_cleanup_call(call);
  132. _leave(" = -EBADSLT");
  133. return -EBADSLT;
  134. }
  135. /*
  136. * Preallocate sufficient service connections, calls and peers to cover the
  137. * entire backlog of a socket. When a new call comes in, if we don't have
  138. * sufficient of each available, the call gets rejected as busy or ignored.
  139. *
  140. * The backlog is replenished when a connection is accepted or rejected.
  141. */
  142. int rxrpc_service_prealloc(struct rxrpc_sock *rx, gfp_t gfp)
  143. {
  144. struct rxrpc_backlog *b = rx->backlog;
  145. if (!b) {
  146. b = kzalloc(sizeof(struct rxrpc_backlog), gfp);
  147. if (!b)
  148. return -ENOMEM;
  149. rx->backlog = b;
  150. }
  151. if (rx->discard_new_call)
  152. return 0;
  153. while (rxrpc_service_prealloc_one(rx, b, NULL, NULL, 0, gfp) == 0)
  154. ;
  155. return 0;
  156. }
  157. /*
  158. * Discard the preallocation on a service.
  159. */
  160. void rxrpc_discard_prealloc(struct rxrpc_sock *rx)
  161. {
  162. struct rxrpc_backlog *b = rx->backlog;
  163. unsigned int size = RXRPC_BACKLOG_MAX, head, tail;
  164. if (!b)
  165. return;
  166. rx->backlog = NULL;
  167. /* Make sure that there aren't any incoming calls in progress before we
  168. * clear the preallocation buffers.
  169. */
  170. spin_lock_bh(&rx->incoming_lock);
  171. spin_unlock_bh(&rx->incoming_lock);
  172. head = b->peer_backlog_head;
  173. tail = b->peer_backlog_tail;
  174. while (CIRC_CNT(head, tail, size) > 0) {
  175. struct rxrpc_peer *peer = b->peer_backlog[tail];
  176. kfree(peer);
  177. tail = (tail + 1) & (size - 1);
  178. }
  179. head = b->conn_backlog_head;
  180. tail = b->conn_backlog_tail;
  181. while (CIRC_CNT(head, tail, size) > 0) {
  182. struct rxrpc_connection *conn = b->conn_backlog[tail];
  183. write_lock(&rxrpc_connection_lock);
  184. list_del(&conn->link);
  185. list_del(&conn->proc_link);
  186. write_unlock(&rxrpc_connection_lock);
  187. kfree(conn);
  188. tail = (tail + 1) & (size - 1);
  189. }
  190. head = b->call_backlog_head;
  191. tail = b->call_backlog_tail;
  192. while (CIRC_CNT(head, tail, size) > 0) {
  193. struct rxrpc_call *call = b->call_backlog[tail];
  194. if (rx->discard_new_call) {
  195. _debug("discard %lx", call->user_call_ID);
  196. rx->discard_new_call(call, call->user_call_ID);
  197. rxrpc_put_call(call, rxrpc_call_put_kernel);
  198. }
  199. rxrpc_call_completed(call);
  200. rxrpc_release_call(rx, call);
  201. rxrpc_put_call(call, rxrpc_call_put);
  202. tail = (tail + 1) & (size - 1);
  203. }
  204. kfree(b);
  205. }
  206. /*
  207. * Allocate a new incoming call from the prealloc pool, along with a connection
  208. * and a peer as necessary.
  209. */
  210. static struct rxrpc_call *rxrpc_alloc_incoming_call(struct rxrpc_sock *rx,
  211. struct rxrpc_local *local,
  212. struct rxrpc_connection *conn,
  213. struct sk_buff *skb)
  214. {
  215. struct rxrpc_backlog *b = rx->backlog;
  216. struct rxrpc_peer *peer, *xpeer;
  217. struct rxrpc_call *call;
  218. unsigned short call_head, conn_head, peer_head;
  219. unsigned short call_tail, conn_tail, peer_tail;
  220. unsigned short call_count, conn_count;
  221. /* #calls >= #conns >= #peers must hold true. */
  222. call_head = smp_load_acquire(&b->call_backlog_head);
  223. call_tail = b->call_backlog_tail;
  224. call_count = CIRC_CNT(call_head, call_tail, RXRPC_BACKLOG_MAX);
  225. conn_head = smp_load_acquire(&b->conn_backlog_head);
  226. conn_tail = b->conn_backlog_tail;
  227. conn_count = CIRC_CNT(conn_head, conn_tail, RXRPC_BACKLOG_MAX);
  228. ASSERTCMP(conn_count, >=, call_count);
  229. peer_head = smp_load_acquire(&b->peer_backlog_head);
  230. peer_tail = b->peer_backlog_tail;
  231. ASSERTCMP(CIRC_CNT(peer_head, peer_tail, RXRPC_BACKLOG_MAX), >=,
  232. conn_count);
  233. if (call_count == 0)
  234. return NULL;
  235. if (!conn) {
  236. /* No connection. We're going to need a peer to start off
  237. * with. If one doesn't yet exist, use a spare from the
  238. * preallocation set. We dump the address into the spare in
  239. * anticipation - and to save on stack space.
  240. */
  241. xpeer = b->peer_backlog[peer_tail];
  242. if (rxrpc_extract_addr_from_skb(&xpeer->srx, skb) < 0)
  243. return NULL;
  244. peer = rxrpc_lookup_incoming_peer(local, xpeer);
  245. if (peer == xpeer) {
  246. b->peer_backlog[peer_tail] = NULL;
  247. smp_store_release(&b->peer_backlog_tail,
  248. (peer_tail + 1) &
  249. (RXRPC_BACKLOG_MAX - 1));
  250. }
  251. /* Now allocate and set up the connection */
  252. conn = b->conn_backlog[conn_tail];
  253. b->conn_backlog[conn_tail] = NULL;
  254. smp_store_release(&b->conn_backlog_tail,
  255. (conn_tail + 1) & (RXRPC_BACKLOG_MAX - 1));
  256. rxrpc_get_local(local);
  257. conn->params.local = local;
  258. conn->params.peer = peer;
  259. rxrpc_see_connection(conn);
  260. rxrpc_new_incoming_connection(conn, skb);
  261. } else {
  262. rxrpc_get_connection(conn);
  263. }
  264. /* And now we can allocate and set up a new call */
  265. call = b->call_backlog[call_tail];
  266. b->call_backlog[call_tail] = NULL;
  267. smp_store_release(&b->call_backlog_tail,
  268. (call_tail + 1) & (RXRPC_BACKLOG_MAX - 1));
  269. rxrpc_see_call(call);
  270. call->conn = conn;
  271. call->peer = rxrpc_get_peer(conn->params.peer);
  272. return call;
  273. }
  274. /*
  275. * Set up a new incoming call. Called in BH context with the RCU read lock
  276. * held.
  277. *
  278. * If this is for a kernel service, when we allocate the call, it will have
  279. * three refs on it: (1) the kernel service, (2) the user_call_ID tree, (3) the
  280. * retainer ref obtained from the backlog buffer. Prealloc calls for userspace
  281. * services only have the ref from the backlog buffer. We want to pass this
  282. * ref to non-BH context to dispose of.
  283. *
  284. * If we want to report an error, we mark the skb with the packet type and
  285. * abort code and return NULL.
  286. */
  287. struct rxrpc_call *rxrpc_new_incoming_call(struct rxrpc_local *local,
  288. struct rxrpc_connection *conn,
  289. struct sk_buff *skb)
  290. {
  291. struct rxrpc_skb_priv *sp = rxrpc_skb(skb);
  292. struct rxrpc_sock *rx;
  293. struct rxrpc_call *call;
  294. u16 service_id = sp->hdr.serviceId;
  295. _enter("");
  296. /* Get the socket providing the service */
  297. rx = rcu_dereference(local->service);
  298. if (rx && service_id == rx->srx.srx_service)
  299. goto found_service;
  300. trace_rxrpc_abort("INV", sp->hdr.cid, sp->hdr.callNumber, sp->hdr.seq,
  301. RX_INVALID_OPERATION, EOPNOTSUPP);
  302. skb->mark = RXRPC_SKB_MARK_LOCAL_ABORT;
  303. skb->priority = RX_INVALID_OPERATION;
  304. _leave(" = NULL [service]");
  305. return NULL;
  306. found_service:
  307. spin_lock(&rx->incoming_lock);
  308. if (rx->sk.sk_state == RXRPC_CLOSE) {
  309. trace_rxrpc_abort("CLS", sp->hdr.cid, sp->hdr.callNumber,
  310. sp->hdr.seq, RX_INVALID_OPERATION, ESHUTDOWN);
  311. skb->mark = RXRPC_SKB_MARK_LOCAL_ABORT;
  312. skb->priority = RX_INVALID_OPERATION;
  313. _leave(" = NULL [close]");
  314. call = NULL;
  315. goto out;
  316. }
  317. call = rxrpc_alloc_incoming_call(rx, local, conn, skb);
  318. if (!call) {
  319. skb->mark = RXRPC_SKB_MARK_BUSY;
  320. _leave(" = NULL [busy]");
  321. call = NULL;
  322. goto out;
  323. }
  324. trace_rxrpc_receive(call, rxrpc_receive_incoming,
  325. sp->hdr.serial, sp->hdr.seq);
  326. /* Make the call live. */
  327. rxrpc_incoming_call(rx, call, skb);
  328. conn = call->conn;
  329. if (rx->notify_new_call)
  330. rx->notify_new_call(&rx->sk, call, call->user_call_ID);
  331. else
  332. sk_acceptq_added(&rx->sk);
  333. spin_lock(&conn->state_lock);
  334. switch (conn->state) {
  335. case RXRPC_CONN_SERVICE_UNSECURED:
  336. conn->state = RXRPC_CONN_SERVICE_CHALLENGING;
  337. set_bit(RXRPC_CONN_EV_CHALLENGE, &call->conn->events);
  338. rxrpc_queue_conn(call->conn);
  339. break;
  340. case RXRPC_CONN_SERVICE:
  341. write_lock(&call->state_lock);
  342. if (rx->discard_new_call)
  343. call->state = RXRPC_CALL_SERVER_RECV_REQUEST;
  344. else
  345. call->state = RXRPC_CALL_SERVER_ACCEPTING;
  346. write_unlock(&call->state_lock);
  347. break;
  348. case RXRPC_CONN_REMOTELY_ABORTED:
  349. rxrpc_set_call_completion(call, RXRPC_CALL_REMOTELY_ABORTED,
  350. conn->remote_abort, ECONNABORTED);
  351. break;
  352. case RXRPC_CONN_LOCALLY_ABORTED:
  353. rxrpc_abort_call("CON", call, sp->hdr.seq,
  354. conn->local_abort, ECONNABORTED);
  355. break;
  356. default:
  357. BUG();
  358. }
  359. spin_unlock(&conn->state_lock);
  360. if (call->state == RXRPC_CALL_SERVER_ACCEPTING)
  361. rxrpc_notify_socket(call);
  362. /* We have to discard the prealloc queue's ref here and rely on a
  363. * combination of the RCU read lock and refs held either by the socket
  364. * (recvmsg queue, to-be-accepted queue or user ID tree) or the kernel
  365. * service to prevent the call from being deallocated too early.
  366. */
  367. rxrpc_put_call(call, rxrpc_call_put);
  368. _leave(" = %p{%d}", call, call->debug_id);
  369. out:
  370. spin_unlock(&rx->incoming_lock);
  371. return call;
  372. }
  373. /*
  374. * handle acceptance of a call by userspace
  375. * - assign the user call ID to the call at the front of the queue
  376. */
  377. struct rxrpc_call *rxrpc_accept_call(struct rxrpc_sock *rx,
  378. unsigned long user_call_ID,
  379. rxrpc_notify_rx_t notify_rx)
  380. {
  381. struct rxrpc_call *call;
  382. struct rb_node *parent, **pp;
  383. int ret;
  384. _enter(",%lx", user_call_ID);
  385. ASSERT(!irqs_disabled());
  386. write_lock(&rx->call_lock);
  387. if (list_empty(&rx->to_be_accepted)) {
  388. write_unlock(&rx->call_lock);
  389. kleave(" = -ENODATA [empty]");
  390. return ERR_PTR(-ENODATA);
  391. }
  392. /* check the user ID isn't already in use */
  393. pp = &rx->calls.rb_node;
  394. parent = NULL;
  395. while (*pp) {
  396. parent = *pp;
  397. call = rb_entry(parent, struct rxrpc_call, sock_node);
  398. if (user_call_ID < call->user_call_ID)
  399. pp = &(*pp)->rb_left;
  400. else if (user_call_ID > call->user_call_ID)
  401. pp = &(*pp)->rb_right;
  402. else
  403. goto id_in_use;
  404. }
  405. /* Dequeue the first call and check it's still valid. We gain
  406. * responsibility for the queue's reference.
  407. */
  408. call = list_entry(rx->to_be_accepted.next,
  409. struct rxrpc_call, accept_link);
  410. list_del_init(&call->accept_link);
  411. sk_acceptq_removed(&rx->sk);
  412. rxrpc_see_call(call);
  413. write_lock_bh(&call->state_lock);
  414. switch (call->state) {
  415. case RXRPC_CALL_SERVER_ACCEPTING:
  416. call->state = RXRPC_CALL_SERVER_RECV_REQUEST;
  417. break;
  418. case RXRPC_CALL_COMPLETE:
  419. ret = call->error;
  420. goto out_release;
  421. default:
  422. BUG();
  423. }
  424. /* formalise the acceptance */
  425. call->notify_rx = notify_rx;
  426. call->user_call_ID = user_call_ID;
  427. rxrpc_get_call(call, rxrpc_call_got_userid);
  428. rb_link_node(&call->sock_node, parent, pp);
  429. rb_insert_color(&call->sock_node, &rx->calls);
  430. if (test_and_set_bit(RXRPC_CALL_HAS_USERID, &call->flags))
  431. BUG();
  432. write_unlock_bh(&call->state_lock);
  433. write_unlock(&rx->call_lock);
  434. rxrpc_notify_socket(call);
  435. rxrpc_service_prealloc(rx, GFP_KERNEL);
  436. _leave(" = %p{%d}", call, call->debug_id);
  437. return call;
  438. out_release:
  439. _debug("release %p", call);
  440. write_unlock_bh(&call->state_lock);
  441. write_unlock(&rx->call_lock);
  442. rxrpc_release_call(rx, call);
  443. rxrpc_put_call(call, rxrpc_call_put);
  444. goto out;
  445. id_in_use:
  446. ret = -EBADSLT;
  447. write_unlock(&rx->call_lock);
  448. out:
  449. rxrpc_service_prealloc(rx, GFP_KERNEL);
  450. _leave(" = %d", ret);
  451. return ERR_PTR(ret);
  452. }
  453. /*
  454. * Handle rejection of a call by userspace
  455. * - reject the call at the front of the queue
  456. */
  457. int rxrpc_reject_call(struct rxrpc_sock *rx)
  458. {
  459. struct rxrpc_call *call;
  460. bool abort = false;
  461. int ret;
  462. _enter("");
  463. ASSERT(!irqs_disabled());
  464. write_lock(&rx->call_lock);
  465. if (list_empty(&rx->to_be_accepted)) {
  466. write_unlock(&rx->call_lock);
  467. return -ENODATA;
  468. }
  469. /* Dequeue the first call and check it's still valid. We gain
  470. * responsibility for the queue's reference.
  471. */
  472. call = list_entry(rx->to_be_accepted.next,
  473. struct rxrpc_call, accept_link);
  474. list_del_init(&call->accept_link);
  475. sk_acceptq_removed(&rx->sk);
  476. rxrpc_see_call(call);
  477. write_lock_bh(&call->state_lock);
  478. switch (call->state) {
  479. case RXRPC_CALL_SERVER_ACCEPTING:
  480. __rxrpc_abort_call("REJ", call, 1, RX_USER_ABORT, ECONNABORTED);
  481. abort = true;
  482. /* fall through */
  483. case RXRPC_CALL_COMPLETE:
  484. ret = call->error;
  485. goto out_discard;
  486. default:
  487. BUG();
  488. }
  489. out_discard:
  490. write_unlock_bh(&call->state_lock);
  491. write_unlock(&rx->call_lock);
  492. if (abort) {
  493. rxrpc_send_abort_packet(call);
  494. rxrpc_release_call(rx, call);
  495. rxrpc_put_call(call, rxrpc_call_put);
  496. }
  497. rxrpc_service_prealloc(rx, GFP_KERNEL);
  498. _leave(" = %d", ret);
  499. return ret;
  500. }
  501. /*
  502. * rxrpc_kernel_charge_accept - Charge up socket with preallocated calls
  503. * @sock: The socket on which to preallocate
  504. * @notify_rx: Event notification function for the call
  505. * @user_attach_call: Func to attach call to user_call_ID
  506. * @user_call_ID: The tag to attach to the preallocated call
  507. * @gfp: The allocation conditions.
  508. *
  509. * Charge up the socket with preallocated calls, each with a user ID. A
  510. * function should be provided to effect the attachment from the user's side.
  511. * The user is given a ref to hold on the call.
  512. *
  513. * Note that the call may be come connected before this function returns.
  514. */
  515. int rxrpc_kernel_charge_accept(struct socket *sock,
  516. rxrpc_notify_rx_t notify_rx,
  517. rxrpc_user_attach_call_t user_attach_call,
  518. unsigned long user_call_ID, gfp_t gfp)
  519. {
  520. struct rxrpc_sock *rx = rxrpc_sk(sock->sk);
  521. struct rxrpc_backlog *b = rx->backlog;
  522. if (sock->sk->sk_state == RXRPC_CLOSE)
  523. return -ESHUTDOWN;
  524. return rxrpc_service_prealloc_one(rx, b, notify_rx,
  525. user_attach_call, user_call_ID,
  526. gfp);
  527. }
  528. EXPORT_SYMBOL(rxrpc_kernel_charge_accept);