lkml.org 
[lkml]   [2010]   [May]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[088/117] sctp: per_cpu variables should be in bh_disabled section
    2.6.33-stable review patch.  If anyone has any objections, please let us know.

    ------------------


    From: Vlad Yasevich <vladislav.yasevich@hp.com>

    [ 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>
    ---
    net/sctp/socket.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    --- a/net/sctp/socket.c
    +++ b/net/sctp/socket.c
    @@ -3718,12 +3718,12 @@ SCTP_STATIC int sctp_init_sock(struct so
    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(struc
    /* 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();
    }



    \
     
     \ /
      Last update: 2010-05-12 10:11    [W:0.041 / U:0.188 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site