diff options
Diffstat (limited to 'net/rxrpc')
| -rw-r--r-- | net/rxrpc/af_rxrpc.c | 13 | ||||
| -rw-r--r-- | net/rxrpc/ar-accept.c | 7 | ||||
| -rw-r--r-- | net/rxrpc/ar-ack.c | 4 | ||||
| -rw-r--r-- | net/rxrpc/ar-call.c | 7 | ||||
| -rw-r--r-- | net/rxrpc/ar-connection.c | 1 | ||||
| -rw-r--r-- | net/rxrpc/ar-input.c | 1 | ||||
| -rw-r--r-- | net/rxrpc/ar-internal.h | 16 | ||||
| -rw-r--r-- | net/rxrpc/ar-key.c | 1 | ||||
| -rw-r--r-- | net/rxrpc/ar-local.c | 1 | ||||
| -rw-r--r-- | net/rxrpc/ar-output.c | 1 | ||||
| -rw-r--r-- | net/rxrpc/ar-peer.c | 5 | ||||
| -rw-r--r-- | net/rxrpc/ar-recvmsg.c | 6 | ||||
| -rw-r--r-- | net/rxrpc/ar-transport.c | 1 | ||||
| -rw-r--r-- | net/rxrpc/rxkad.c | 1 |
14 files changed, 40 insertions, 25 deletions
diff --git a/net/rxrpc/af_rxrpc.c b/net/rxrpc/af_rxrpc.c index 287b1415cee9..0b9bb2085ce4 100644 --- a/net/rxrpc/af_rxrpc.c +++ b/net/rxrpc/af_rxrpc.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
| 13 | #include <linux/net.h> | 13 | #include <linux/net.h> |
| 14 | #include <linux/slab.h> | ||
| 14 | #include <linux/skbuff.h> | 15 | #include <linux/skbuff.h> |
| 15 | #include <linux/poll.h> | 16 | #include <linux/poll.h> |
| 16 | #include <linux/proc_fs.h> | 17 | #include <linux/proc_fs.h> |
| @@ -61,13 +62,15 @@ static inline int rxrpc_writable(struct sock *sk) | |||
| 61 | static void rxrpc_write_space(struct sock *sk) | 62 | static void rxrpc_write_space(struct sock *sk) |
| 62 | { | 63 | { |
| 63 | _enter("%p", sk); | 64 | _enter("%p", sk); |
| 64 | read_lock(&sk->sk_callback_lock); | 65 | rcu_read_lock(); |
| 65 | if (rxrpc_writable(sk)) { | 66 | if (rxrpc_writable(sk)) { |
| 66 | if (sk_has_sleeper(sk)) | 67 | struct socket_wq *wq = rcu_dereference(sk->sk_wq); |
| 67 | wake_up_interruptible(sk->sk_sleep); | 68 | |
| 69 | if (wq_has_sleeper(wq)) | ||
| 70 | wake_up_interruptible(&wq->wait); | ||
| 68 | sk_wake_async(sk, SOCK_WAKE_SPACE, POLL_OUT); | 71 | sk_wake_async(sk, SOCK_WAKE_SPACE, POLL_OUT); |
| 69 | } | 72 | } |
| 70 | read_unlock(&sk->sk_callback_lock); | 73 | rcu_read_unlock(); |
| 71 | } | 74 | } |
| 72 | 75 | ||
| 73 | /* | 76 | /* |
| @@ -588,7 +591,7 @@ static unsigned int rxrpc_poll(struct file *file, struct socket *sock, | |||
| 588 | unsigned int mask; | 591 | unsigned int mask; |
| 589 | struct sock *sk = sock->sk; | 592 | struct sock *sk = sock->sk; |
| 590 | 593 | ||
| 591 | sock_poll_wait(file, sk->sk_sleep, wait); | 594 | sock_poll_wait(file, sk_sleep(sk), wait); |
| 592 | mask = 0; | 595 | mask = 0; |
| 593 | 596 | ||
| 594 | /* the socket is readable if there are any messages waiting on the Rx | 597 | /* the socket is readable if there are any messages waiting on the Rx |
diff --git a/net/rxrpc/ar-accept.c b/net/rxrpc/ar-accept.c index 77228f28fa36..6d79310fcaae 100644 --- a/net/rxrpc/ar-accept.c +++ b/net/rxrpc/ar-accept.c | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #include <linux/in.h> | 17 | #include <linux/in.h> |
| 18 | #include <linux/in6.h> | 18 | #include <linux/in6.h> |
| 19 | #include <linux/icmp.h> | 19 | #include <linux/icmp.h> |
| 20 | #include <linux/gfp.h> | ||
| 20 | #include <net/sock.h> | 21 | #include <net/sock.h> |
| 21 | #include <net/af_rxrpc.h> | 22 | #include <net/af_rxrpc.h> |
| 22 | #include <net/ip.h> | 23 | #include <net/ip.h> |
| @@ -88,6 +89,11 @@ static int rxrpc_accept_incoming_call(struct rxrpc_local *local, | |||
| 88 | 89 | ||
| 89 | /* get a notification message to send to the server app */ | 90 | /* get a notification message to send to the server app */ |
| 90 | notification = alloc_skb(0, GFP_NOFS); | 91 | notification = alloc_skb(0, GFP_NOFS); |
| 92 | if (!notification) { | ||
| 93 | _debug("no memory"); | ||
| 94 | ret = -ENOMEM; | ||
| 95 | goto error_nofree; | ||
| 96 | } | ||
| 91 | rxrpc_new_skb(notification); | 97 | rxrpc_new_skb(notification); |
| 92 | notification->mark = RXRPC_SKB_MARK_NEW_CALL; | 98 | notification->mark = RXRPC_SKB_MARK_NEW_CALL; |
| 93 | 99 | ||
| @@ -189,6 +195,7 @@ invalid_service: | |||
| 189 | ret = -ECONNREFUSED; | 195 | ret = -ECONNREFUSED; |
| 190 | error: | 196 | error: |
| 191 | rxrpc_free_skb(notification); | 197 | rxrpc_free_skb(notification); |
| 198 | error_nofree: | ||
| 192 | _leave(" = %d", ret); | 199 | _leave(" = %d", ret); |
| 193 | return ret; | 200 | return ret; |
| 194 | } | 201 | } |
diff --git a/net/rxrpc/ar-ack.c b/net/rxrpc/ar-ack.c index b4a220977031..b6ffe4e1b84a 100644 --- a/net/rxrpc/ar-ack.c +++ b/net/rxrpc/ar-ack.c | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #include <linux/circ_buf.h> | 13 | #include <linux/circ_buf.h> |
| 14 | #include <linux/net.h> | 14 | #include <linux/net.h> |
| 15 | #include <linux/skbuff.h> | 15 | #include <linux/skbuff.h> |
| 16 | #include <linux/slab.h> | ||
| 16 | #include <linux/udp.h> | 17 | #include <linux/udp.h> |
| 17 | #include <net/sock.h> | 18 | #include <net/sock.h> |
| 18 | #include <net/af_rxrpc.h> | 19 | #include <net/af_rxrpc.h> |
| @@ -244,6 +245,9 @@ static void rxrpc_resend_timer(struct rxrpc_call *call) | |||
| 244 | _enter("%d,%d,%d", | 245 | _enter("%d,%d,%d", |
| 245 | call->acks_tail, call->acks_unacked, call->acks_head); | 246 | call->acks_tail, call->acks_unacked, call->acks_head); |
| 246 | 247 | ||
| 248 | if (call->state >= RXRPC_CALL_COMPLETE) | ||
| 249 | return; | ||
| 250 | |||
| 247 | resend = 0; | 251 | resend = 0; |
| 248 | resend_at = 0; | 252 | resend_at = 0; |
| 249 | 253 | ||
diff --git a/net/rxrpc/ar-call.c b/net/rxrpc/ar-call.c index bc0019f704fe..bf656c230ba9 100644 --- a/net/rxrpc/ar-call.c +++ b/net/rxrpc/ar-call.c | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | * 2 of the License, or (at your option) any later version. | 9 | * 2 of the License, or (at your option) any later version. |
| 10 | */ | 10 | */ |
| 11 | 11 | ||
| 12 | #include <linux/slab.h> | ||
| 12 | #include <linux/module.h> | 13 | #include <linux/module.h> |
| 13 | #include <linux/circ_buf.h> | 14 | #include <linux/circ_buf.h> |
| 14 | #include <net/sock.h> | 15 | #include <net/sock.h> |
| @@ -785,6 +786,7 @@ static void rxrpc_call_life_expired(unsigned long _call) | |||
| 785 | 786 | ||
| 786 | /* | 787 | /* |
| 787 | * handle resend timer expiry | 788 | * handle resend timer expiry |
| 789 | * - may not take call->state_lock as this can deadlock against del_timer_sync() | ||
| 788 | */ | 790 | */ |
| 789 | static void rxrpc_resend_time_expired(unsigned long _call) | 791 | static void rxrpc_resend_time_expired(unsigned long _call) |
| 790 | { | 792 | { |
| @@ -795,12 +797,9 @@ static void rxrpc_resend_time_expired(unsigned long _call) | |||
| 795 | if (call->state >= RXRPC_CALL_COMPLETE) | 797 | if (call->state >= RXRPC_CALL_COMPLETE) |
| 796 | return; | 798 | return; |
| 797 | 799 | ||
| 798 | read_lock_bh(&call->state_lock); | ||
| 799 | clear_bit(RXRPC_CALL_RUN_RTIMER, &call->flags); | 800 | clear_bit(RXRPC_CALL_RUN_RTIMER, &call->flags); |
| 800 | if (call->state < RXRPC_CALL_COMPLETE && | 801 | if (!test_and_set_bit(RXRPC_CALL_RESEND_TIMER, &call->events)) |
| 801 | !test_and_set_bit(RXRPC_CALL_RESEND_TIMER, &call->events)) | ||
| 802 | rxrpc_queue_call(call); | 802 | rxrpc_queue_call(call); |
| 803 | read_unlock_bh(&call->state_lock); | ||
| 804 | } | 803 | } |
| 805 | 804 | ||
| 806 | /* | 805 | /* |
diff --git a/net/rxrpc/ar-connection.c b/net/rxrpc/ar-connection.c index 9f1ce841a0bb..4106ca95ec86 100644 --- a/net/rxrpc/ar-connection.c +++ b/net/rxrpc/ar-connection.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | */ | 10 | */ |
| 11 | 11 | ||
| 12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
| 13 | #include <linux/slab.h> | ||
| 13 | #include <linux/net.h> | 14 | #include <linux/net.h> |
| 14 | #include <linux/skbuff.h> | 15 | #include <linux/skbuff.h> |
| 15 | #include <linux/crypto.h> | 16 | #include <linux/crypto.h> |
diff --git a/net/rxrpc/ar-input.c b/net/rxrpc/ar-input.c index f98c8027e5c1..89315009bab1 100644 --- a/net/rxrpc/ar-input.c +++ b/net/rxrpc/ar-input.c | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #include <linux/in.h> | 17 | #include <linux/in.h> |
| 18 | #include <linux/in6.h> | 18 | #include <linux/in6.h> |
| 19 | #include <linux/icmp.h> | 19 | #include <linux/icmp.h> |
| 20 | #include <linux/gfp.h> | ||
| 20 | #include <net/sock.h> | 21 | #include <net/sock.h> |
| 21 | #include <net/af_rxrpc.h> | 22 | #include <net/af_rxrpc.h> |
| 22 | #include <net/ip.h> | 23 | #include <net/ip.h> |
diff --git a/net/rxrpc/ar-internal.h b/net/rxrpc/ar-internal.h index 7043b294bb67..8e22bd345e71 100644 --- a/net/rxrpc/ar-internal.h +++ b/net/rxrpc/ar-internal.h | |||
| @@ -597,12 +597,6 @@ extern unsigned rxrpc_debug; | |||
| 597 | #define dbgprintk(FMT,...) \ | 597 | #define dbgprintk(FMT,...) \ |
| 598 | printk("[%-6.6s] "FMT"\n", current->comm ,##__VA_ARGS__) | 598 | printk("[%-6.6s] "FMT"\n", current->comm ,##__VA_ARGS__) |
| 599 | 599 | ||
| 600 | /* make sure we maintain the format strings, even when debugging is disabled */ | ||
| 601 | static inline __attribute__((format(printf,1,2))) | ||
| 602 | void _dbprintk(const char *fmt, ...) | ||
| 603 | { | ||
| 604 | } | ||
| 605 | |||
| 606 | #define kenter(FMT,...) dbgprintk("==> %s("FMT")",__func__ ,##__VA_ARGS__) | 600 | #define kenter(FMT,...) dbgprintk("==> %s("FMT")",__func__ ,##__VA_ARGS__) |
| 607 | #define kleave(FMT,...) dbgprintk("<== %s()"FMT"",__func__ ,##__VA_ARGS__) | 601 | #define kleave(FMT,...) dbgprintk("<== %s()"FMT"",__func__ ,##__VA_ARGS__) |
| 608 | #define kdebug(FMT,...) dbgprintk(" "FMT ,##__VA_ARGS__) | 602 | #define kdebug(FMT,...) dbgprintk(" "FMT ,##__VA_ARGS__) |
| @@ -655,11 +649,11 @@ do { \ | |||
| 655 | } while (0) | 649 | } while (0) |
| 656 | 650 | ||
| 657 | #else | 651 | #else |
| 658 | #define _enter(FMT,...) _dbprintk("==> %s("FMT")",__func__ ,##__VA_ARGS__) | 652 | #define _enter(FMT,...) no_printk("==> %s("FMT")",__func__ ,##__VA_ARGS__) |
| 659 | #define _leave(FMT,...) _dbprintk("<== %s()"FMT"",__func__ ,##__VA_ARGS__) | 653 | #define _leave(FMT,...) no_printk("<== %s()"FMT"",__func__ ,##__VA_ARGS__) |
| 660 | #define _debug(FMT,...) _dbprintk(" "FMT ,##__VA_ARGS__) | 654 | #define _debug(FMT,...) no_printk(" "FMT ,##__VA_ARGS__) |
| 661 | #define _proto(FMT,...) _dbprintk("### "FMT ,##__VA_ARGS__) | 655 | #define _proto(FMT,...) no_printk("### "FMT ,##__VA_ARGS__) |
| 662 | #define _net(FMT,...) _dbprintk("@@@ "FMT ,##__VA_ARGS__) | 656 | #define _net(FMT,...) no_printk("@@@ "FMT ,##__VA_ARGS__) |
| 663 | #endif | 657 | #endif |
| 664 | 658 | ||
| 665 | /* | 659 | /* |
diff --git a/net/rxrpc/ar-key.c b/net/rxrpc/ar-key.c index 74697b200496..5ee16f0353fe 100644 --- a/net/rxrpc/ar-key.c +++ b/net/rxrpc/ar-key.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/key-type.h> | 18 | #include <linux/key-type.h> |
| 19 | #include <linux/crypto.h> | 19 | #include <linux/crypto.h> |
| 20 | #include <linux/ctype.h> | 20 | #include <linux/ctype.h> |
| 21 | #include <linux/slab.h> | ||
| 21 | #include <net/sock.h> | 22 | #include <net/sock.h> |
| 22 | #include <net/af_rxrpc.h> | 23 | #include <net/af_rxrpc.h> |
| 23 | #include <keys/rxrpc-type.h> | 24 | #include <keys/rxrpc-type.h> |
diff --git a/net/rxrpc/ar-local.c b/net/rxrpc/ar-local.c index 807535ff29b5..87f7135d238b 100644 --- a/net/rxrpc/ar-local.c +++ b/net/rxrpc/ar-local.c | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
| 13 | #include <linux/net.h> | 13 | #include <linux/net.h> |
| 14 | #include <linux/skbuff.h> | 14 | #include <linux/skbuff.h> |
| 15 | #include <linux/slab.h> | ||
| 15 | #include <net/sock.h> | 16 | #include <net/sock.h> |
| 16 | #include <net/af_rxrpc.h> | 17 | #include <net/af_rxrpc.h> |
| 17 | #include "ar-internal.h" | 18 | #include "ar-internal.h" |
diff --git a/net/rxrpc/ar-output.c b/net/rxrpc/ar-output.c index cc9102c5b588..5f22e263eda7 100644 --- a/net/rxrpc/ar-output.c +++ b/net/rxrpc/ar-output.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | */ | 10 | */ |
| 11 | 11 | ||
| 12 | #include <linux/net.h> | 12 | #include <linux/net.h> |
| 13 | #include <linux/gfp.h> | ||
| 13 | #include <linux/skbuff.h> | 14 | #include <linux/skbuff.h> |
| 14 | #include <linux/circ_buf.h> | 15 | #include <linux/circ_buf.h> |
| 15 | #include <net/sock.h> | 16 | #include <net/sock.h> |
diff --git a/net/rxrpc/ar-peer.c b/net/rxrpc/ar-peer.c index edc026c1eb76..9f1729bd60de 100644 --- a/net/rxrpc/ar-peer.c +++ b/net/rxrpc/ar-peer.c | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include <linux/in.h> | 16 | #include <linux/in.h> |
| 17 | #include <linux/in6.h> | 17 | #include <linux/in6.h> |
| 18 | #include <linux/icmp.h> | 18 | #include <linux/icmp.h> |
| 19 | #include <linux/slab.h> | ||
| 19 | #include <net/sock.h> | 20 | #include <net/sock.h> |
| 20 | #include <net/af_rxrpc.h> | 21 | #include <net/af_rxrpc.h> |
| 21 | #include <net/ip.h> | 22 | #include <net/ip.h> |
| @@ -63,8 +64,8 @@ static void rxrpc_assess_MTU_size(struct rxrpc_peer *peer) | |||
| 63 | return; | 64 | return; |
| 64 | } | 65 | } |
| 65 | 66 | ||
| 66 | peer->if_mtu = dst_mtu(&rt->u.dst); | 67 | peer->if_mtu = dst_mtu(&rt->dst); |
| 67 | dst_release(&rt->u.dst); | 68 | dst_release(&rt->dst); |
| 68 | 69 | ||
| 69 | _leave(" [if_mtu %u]", peer->if_mtu); | 70 | _leave(" [if_mtu %u]", peer->if_mtu); |
| 70 | } | 71 | } |
diff --git a/net/rxrpc/ar-recvmsg.c b/net/rxrpc/ar-recvmsg.c index 60c2b94e6b54..0c65013e3bfe 100644 --- a/net/rxrpc/ar-recvmsg.c +++ b/net/rxrpc/ar-recvmsg.c | |||
| @@ -91,7 +91,7 @@ int rxrpc_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
| 91 | 91 | ||
| 92 | /* wait for a message to turn up */ | 92 | /* wait for a message to turn up */ |
| 93 | release_sock(&rx->sk); | 93 | release_sock(&rx->sk); |
| 94 | prepare_to_wait_exclusive(rx->sk.sk_sleep, &wait, | 94 | prepare_to_wait_exclusive(sk_sleep(&rx->sk), &wait, |
| 95 | TASK_INTERRUPTIBLE); | 95 | TASK_INTERRUPTIBLE); |
| 96 | ret = sock_error(&rx->sk); | 96 | ret = sock_error(&rx->sk); |
| 97 | if (ret) | 97 | if (ret) |
| @@ -102,7 +102,7 @@ int rxrpc_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
| 102 | goto wait_interrupted; | 102 | goto wait_interrupted; |
| 103 | timeo = schedule_timeout(timeo); | 103 | timeo = schedule_timeout(timeo); |
| 104 | } | 104 | } |
| 105 | finish_wait(rx->sk.sk_sleep, &wait); | 105 | finish_wait(sk_sleep(&rx->sk), &wait); |
| 106 | lock_sock(&rx->sk); | 106 | lock_sock(&rx->sk); |
| 107 | continue; | 107 | continue; |
| 108 | } | 108 | } |
| @@ -356,7 +356,7 @@ csum_copy_error: | |||
| 356 | wait_interrupted: | 356 | wait_interrupted: |
| 357 | ret = sock_intr_errno(timeo); | 357 | ret = sock_intr_errno(timeo); |
| 358 | wait_error: | 358 | wait_error: |
| 359 | finish_wait(rx->sk.sk_sleep, &wait); | 359 | finish_wait(sk_sleep(&rx->sk), &wait); |
| 360 | if (continue_call) | 360 | if (continue_call) |
| 361 | rxrpc_put_call(continue_call); | 361 | rxrpc_put_call(continue_call); |
| 362 | if (copied) | 362 | if (copied) |
diff --git a/net/rxrpc/ar-transport.c b/net/rxrpc/ar-transport.c index 0936e1acc30e..5e0226fe587e 100644 --- a/net/rxrpc/ar-transport.c +++ b/net/rxrpc/ar-transport.c | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
| 13 | #include <linux/net.h> | 13 | #include <linux/net.h> |
| 14 | #include <linux/skbuff.h> | 14 | #include <linux/skbuff.h> |
| 15 | #include <linux/slab.h> | ||
| 15 | #include <net/sock.h> | 16 | #include <net/sock.h> |
| 16 | #include <net/af_rxrpc.h> | 17 | #include <net/af_rxrpc.h> |
| 17 | #include "ar-internal.h" | 18 | #include "ar-internal.h" |
diff --git a/net/rxrpc/rxkad.c b/net/rxrpc/rxkad.c index 713ac593e2e9..7635107726ce 100644 --- a/net/rxrpc/rxkad.c +++ b/net/rxrpc/rxkad.c | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include <linux/crypto.h> | 16 | #include <linux/crypto.h> |
| 17 | #include <linux/scatterlist.h> | 17 | #include <linux/scatterlist.h> |
| 18 | #include <linux/ctype.h> | 18 | #include <linux/ctype.h> |
| 19 | #include <linux/slab.h> | ||
| 19 | #include <net/sock.h> | 20 | #include <net/sock.h> |
| 20 | #include <net/af_rxrpc.h> | 21 | #include <net/af_rxrpc.h> |
| 21 | #include <keys/rxrpc-type.h> | 22 | #include <keys/rxrpc-type.h> |
