diff options
author | Vlad Yasevich <vladislav.yasevich@hp.com> | 2010-04-28 08:47:20 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-12 15:02:58 -0700 |
commit | eddb4b2aebd5e13049c9fa20f38ff8485a6341aa (patch) | |
tree | 349063ad6074aee47780ead4cff0f2c3f9105bbf /net/sctp | |
parent | c9d7c3032e4d5850c4e019c186336466aa429626 (diff) |
sctp: per_cpu variables should be in bh_disabled section
[ Upstream commit 81419d862db743fe4450a021893f24bab4698c1d ]
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: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'net/sctp')
-rw-r--r-- | net/sctp/socket.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 97246b1c1ff..aa3ba60de54 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -3718,12 +3718,12 @@ SCTP_STATIC int sctp_init_sock(struct sock *sk) sp->hmac = NULL; SCTP_DBG_OBJCNT_INC(sock); - percpu_counter_inc(&sctp_sockets_allocated); /* Set socket backlog limit. */ sk->sk_backlog.limit = sysctl_sctp_rmem[1]; local_bh_disable(); + percpu_counter_inc(&sctp_sockets_allocated); sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1); local_bh_enable(); @@ -3740,8 +3740,8 @@ SCTP_STATIC void sctp_destroy_sock(struct sock *sk) /* Release our hold on the endpoint. */ ep = sctp_sk(sk)->ep; sctp_endpoint_free(ep); - percpu_counter_dec(&sctp_sockets_allocated); local_bh_disable(); + percpu_counter_dec(&sctp_sockets_allocated); sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1); local_bh_enable(); } |