提交 81419d86 编写于 作者: V Vlad Yasevich 提交者: David S. Miller

sctp: per_cpu variables should be in bh_disabled section

Since the change of the atomics to percpu variables, we now
have to disable BH in process context when touching percpu variables.
Signed-off-by: NVlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 0c42749c
...@@ -3719,12 +3719,12 @@ SCTP_STATIC int sctp_init_sock(struct sock *sk) ...@@ -3719,12 +3719,12 @@ SCTP_STATIC int sctp_init_sock(struct sock *sk)
sp->hmac = NULL; sp->hmac = NULL;
SCTP_DBG_OBJCNT_INC(sock); SCTP_DBG_OBJCNT_INC(sock);
percpu_counter_inc(&sctp_sockets_allocated);
/* Set socket backlog limit. */ /* Set socket backlog limit. */
sk->sk_backlog.limit = sysctl_sctp_rmem[1]; sk->sk_backlog.limit = sysctl_sctp_rmem[1];
local_bh_disable(); local_bh_disable();
percpu_counter_inc(&sctp_sockets_allocated);
sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1); sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1);
local_bh_enable(); local_bh_enable();
...@@ -3741,8 +3741,8 @@ SCTP_STATIC void sctp_destroy_sock(struct sock *sk) ...@@ -3741,8 +3741,8 @@ SCTP_STATIC void sctp_destroy_sock(struct sock *sk)
/* Release our hold on the endpoint. */ /* Release our hold on the endpoint. */
ep = sctp_sk(sk)->ep; ep = sctp_sk(sk)->ep;
sctp_endpoint_free(ep); sctp_endpoint_free(ep);
percpu_counter_dec(&sctp_sockets_allocated);
local_bh_disable(); local_bh_disable();
percpu_counter_dec(&sctp_sockets_allocated);
sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1); sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);
local_bh_enable(); local_bh_enable();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册