aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVlad Yasevich <vladislav.yasevich@hp.com>2010-04-28 04:47:20 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-12 18:02:58 -0400
commiteddb4b2aebd5e13049c9fa20f38ff8485a6341aa (patch)
tree349063ad6074aee47780ead4cff0f2c3f9105bbf
parentc9d7c3032e4d5850c4e019c186336466aa429626 (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>
-rw-r--r--net/sctp/socket.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 97246b1c1ff7..aa3ba60de54c 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -3718,12 +3718,12 @@ SCTP_STATIC int sctp_init_sock(struct sock *sk)
3718 sp->hmac = NULL; 3718 sp->hmac = NULL;
3719 3719
3720 SCTP_DBG_OBJCNT_INC(sock); 3720 SCTP_DBG_OBJCNT_INC(sock);
3721 percpu_counter_inc(&sctp_sockets_allocated);
3722 3721
3723 /* Set socket backlog limit. */ 3722 /* Set socket backlog limit. */
3724 sk->sk_backlog.limit = sysctl_sctp_rmem[1]; 3723 sk->sk_backlog.limit = sysctl_sctp_rmem[1];
3725 3724
3726 local_bh_disable(); 3725 local_bh_disable();
3726 percpu_counter_inc(&sctp_sockets_allocated);
3727 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1); 3727 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1);
3728 local_bh_enable(); 3728 local_bh_enable();
3729 3729
@@ -3740,8 +3740,8 @@ SCTP_STATIC void sctp_destroy_sock(struct sock *sk)
3740 /* Release our hold on the endpoint. */ 3740 /* Release our hold on the endpoint. */
3741 ep = sctp_sk(sk)->ep; 3741 ep = sctp_sk(sk)->ep;
3742 sctp_endpoint_free(ep); 3742 sctp_endpoint_free(ep);
3743 percpu_counter_dec(&sctp_sockets_allocated);
3744 local_bh_disable(); 3743 local_bh_disable();
3744 percpu_counter_dec(&sctp_sockets_allocated);
3745 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1); 3745 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);
3746 local_bh_enable(); 3746 local_bh_enable();
3747} 3747}