sctp: simplify sk_receive_queue locking
[cascardo/linux.git] / net / sctp / socket.c
index 878d28e..bf265a4 100644 (file)
@@ -6430,6 +6430,8 @@ unsigned int sctp_poll(struct file *file, struct socket *sock, poll_table *wait)
 
        poll_wait(file, sk_sleep(sk), wait);
 
+       sock_rps_record_flow(sk);
+
        /* A TCP-style listening socket becomes readable when the accept queue
         * is not empty.
         */
@@ -6764,13 +6766,11 @@ struct sk_buff *sctp_skb_recv_datagram(struct sock *sk, int flags,
                 *  However, this function was correct in any case. 8)
                 */
                if (flags & MSG_PEEK) {
-                       spin_lock_bh(&sk->sk_receive_queue.lock);
                        skb = skb_peek(&sk->sk_receive_queue);
                        if (skb)
                                atomic_inc(&skb->users);
-                       spin_unlock_bh(&sk->sk_receive_queue.lock);
                } else {
-                       skb = skb_dequeue(&sk->sk_receive_queue);
+                       skb = __skb_dequeue(&sk->sk_receive_queue);
                }
 
                if (skb)
@@ -7186,6 +7186,7 @@ void sctp_copy_sock(struct sock *newsk, struct sock *sk,
        newsk->sk_lingertime = sk->sk_lingertime;
        newsk->sk_rcvtimeo = sk->sk_rcvtimeo;
        newsk->sk_sndtimeo = sk->sk_sndtimeo;
+       newsk->sk_rxhash = sk->sk_rxhash;
 
        newinet = inet_sk(newsk);