Commit 7976a11b authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

net: use helpers to change sk_ack_backlog



Writers are holding a lock, but many readers do not.

Following patch will add appropriate barriers in
sk_acceptq_removed() and sk_acceptq_added().

Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 25c7a6d1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -109,7 +109,7 @@ static int sigd_send(struct atm_vcc *vcc, struct sk_buff *skb)
			dev_kfree_skb(skb);
			goto as_indicate_complete;
		}
		sk->sk_ack_backlog++;
		sk_acceptq_added(sk);
		skb_queue_tail(&sk->sk_receive_queue, skb);
		pr_debug("waking sk_sleep(sk) 0x%p\n", sk_sleep(sk));
		sk->sk_state_change(sk);
+1 −1
Original line number Diff line number Diff line
@@ -381,7 +381,7 @@ static int svc_accept(struct socket *sock, struct socket *newsock, int flags,
				    msg->pvc.sap_addr.vpi,
				    msg->pvc.sap_addr.vci);
		dev_kfree_skb(skb);
		sk->sk_ack_backlog--;
		sk_acceptq_removed(sk);
		if (error) {
			sigd_enq2(NULL, as_reject, old_vcc, NULL, NULL,
				  &old_vcc->qos, error);
+1 −1
Original line number Diff line number Diff line
@@ -1384,7 +1384,7 @@ static int ax25_accept(struct socket *sock, struct socket *newsock, int flags,

	/* Now attach up the new socket */
	kfree_skb(skb);
	sk->sk_ack_backlog--;
	sk_acceptq_removed(sk);
	newsock->state = SS_CONNECTED;

out:
+1 −1
Original line number Diff line number Diff line
@@ -356,7 +356,7 @@ static int ax25_rcv(struct sk_buff *skb, struct net_device *dev,

		make->sk_state = TCP_ESTABLISHED;

		sk->sk_ack_backlog++;
		sk_acceptq_added(sk);
		bh_unlock_sock(sk);
	} else {
		if (!mine)
+2 −2
Original line number Diff line number Diff line
@@ -173,7 +173,7 @@ void bt_accept_enqueue(struct sock *parent, struct sock *sk, bool bh)
	else
		release_sock(sk);

	parent->sk_ack_backlog++;
	sk_acceptq_added(parent);
}
EXPORT_SYMBOL(bt_accept_enqueue);

@@ -185,7 +185,7 @@ void bt_accept_unlink(struct sock *sk)
	BT_DBG("sk %p state %d", sk, sk->sk_state);

	list_del_init(&bt_sk(sk)->accept_q);
	bt_sk(sk)->parent->sk_ack_backlog--;
	sk_acceptq_removed(bt_sk(sk)->parent);
	bt_sk(sk)->parent = NULL;
	sock_put(sk);
}
Loading