Skip to content

Commit 7976a11

Browse files
edumazetdavem330
authored andcommitted
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: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 25c7a6d commit 7976a11

File tree

16 files changed

+21
-21
lines changed

16 files changed

+21
-21
lines changed

net/atm/signaling.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ static int sigd_send(struct atm_vcc *vcc, struct sk_buff *skb)
109109
dev_kfree_skb(skb);
110110
goto as_indicate_complete;
111111
}
112-
sk->sk_ack_backlog++;
112+
sk_acceptq_added(sk);
113113
skb_queue_tail(&sk->sk_receive_queue, skb);
114114
pr_debug("waking sk_sleep(sk) 0x%p\n", sk_sleep(sk));
115115
sk->sk_state_change(sk);

net/atm/svc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ static int svc_accept(struct socket *sock, struct socket *newsock, int flags,
381381
msg->pvc.sap_addr.vpi,
382382
msg->pvc.sap_addr.vci);
383383
dev_kfree_skb(skb);
384-
sk->sk_ack_backlog--;
384+
sk_acceptq_removed(sk);
385385
if (error) {
386386
sigd_enq2(NULL, as_reject, old_vcc, NULL, NULL,
387387
&old_vcc->qos, error);

net/ax25/af_ax25.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,7 @@ static int ax25_accept(struct socket *sock, struct socket *newsock, int flags,
13841384

13851385
/* Now attach up the new socket */
13861386
kfree_skb(skb);
1387-
sk->sk_ack_backlog--;
1387+
sk_acceptq_removed(sk);
13881388
newsock->state = SS_CONNECTED;
13891389

13901390
out:

net/ax25/ax25_in.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ static int ax25_rcv(struct sk_buff *skb, struct net_device *dev,
356356

357357
make->sk_state = TCP_ESTABLISHED;
358358

359-
sk->sk_ack_backlog++;
359+
sk_acceptq_added(sk);
360360
bh_unlock_sock(sk);
361361
} else {
362362
if (!mine)

net/bluetooth/af_bluetooth.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ void bt_accept_enqueue(struct sock *parent, struct sock *sk, bool bh)
173173
else
174174
release_sock(sk);
175175

176-
parent->sk_ack_backlog++;
176+
sk_acceptq_added(parent);
177177
}
178178
EXPORT_SYMBOL(bt_accept_enqueue);
179179

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

187187
list_del_init(&bt_sk(sk)->accept_q);
188-
bt_sk(sk)->parent->sk_ack_backlog--;
188+
sk_acceptq_removed(bt_sk(sk)->parent);
189189
bt_sk(sk)->parent = NULL;
190190
sock_put(sk);
191191
}

net/decnet/af_decnet.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,7 @@ static int dn_accept(struct socket *sock, struct socket *newsock, int flags,
10911091
}
10921092

10931093
cb = DN_SKB_CB(skb);
1094-
sk->sk_ack_backlog--;
1094+
sk_acceptq_removed(sk);
10951095
newsk = dn_alloc_sock(sock_net(sk), newsock, sk->sk_allocation, kern);
10961096
if (newsk == NULL) {
10971097
release_sock(sk);

net/decnet/dn_nsp_in.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ static void dn_nsp_conn_init(struct sock *sk, struct sk_buff *skb)
328328
return;
329329
}
330330

331-
sk->sk_ack_backlog++;
331+
sk_acceptq_added(sk);
332332
skb_queue_tail(&sk->sk_receive_queue, skb);
333333
sk->sk_state_change(sk);
334334
}

net/llc/af_llc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ static int llc_ui_accept(struct socket *sock, struct socket *newsock, int flags,
705705

706706
/* put original socket back into a clean listen state. */
707707
sk->sk_state = TCP_LISTEN;
708-
sk->sk_ack_backlog--;
708+
sk_acceptq_removed(sk);
709709
dprintk("%s: ok success on %02X, client on %02X\n", __func__,
710710
llc_sk(sk)->addr.sllc_sap, newllc->daddr.lsap);
711711
frees:

net/rose/af_rose.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,7 @@ static int rose_accept(struct socket *sock, struct socket *newsock, int flags,
906906
/* Now attach up the new socket */
907907
skb->sk = NULL;
908908
kfree_skb(skb);
909-
sk->sk_ack_backlog--;
909+
sk_acceptq_removed(sk);
910910

911911
out_release:
912912
release_sock(sk);
@@ -1011,7 +1011,7 @@ int rose_rx_call_request(struct sk_buff *skb, struct net_device *dev, struct ros
10111011
make_rose->va = 0;
10121012
make_rose->vr = 0;
10131013
make_rose->vl = 0;
1014-
sk->sk_ack_backlog++;
1014+
sk_acceptq_added(sk);
10151015

10161016
rose_insert_socket(make);
10171017

net/sctp/associola.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ void sctp_association_free(struct sctp_association *asoc)
324324
* socket.
325325
*/
326326
if (sctp_style(sk, TCP) && sctp_sstate(sk, LISTENING))
327-
sk->sk_ack_backlog--;
327+
sk_acceptq_removed(sk);
328328
}
329329

330330
/* Mark as dead, so other users can know this structure is
@@ -1073,7 +1073,7 @@ void sctp_assoc_migrate(struct sctp_association *assoc, struct sock *newsk)
10731073

10741074
/* Decrement the backlog value for a TCP-style socket. */
10751075
if (sctp_style(oldsk, TCP))
1076-
oldsk->sk_ack_backlog--;
1076+
sk_acceptq_removed(oldsk);
10771077

10781078
/* Release references to the old endpoint and the sock. */
10791079
sctp_endpoint_put(assoc->ep);

0 commit comments

Comments
 (0)