• Wei Yongjun's avatar
    sctp: avoid irq lock inversion while call sk->sk_data_ready() · 561b1733
    Wei Yongjun authored
    sk->sk_data_ready() of sctp socket can be called from both BH and non-BH
    contexts, but the default sk->sk_data_ready(), sock_def_readable(), can
    not be used in this case. Therefore, we have to make a new function
    sctp_data_ready() to grab sk->sk_data_ready() with BH disabling.
    
    =========================================================
    [ INFO: possible irq lock inversion dependency detected ]
    2.6.33-rc6 #129
    ---------------------------------------------------------
    sctp_darn/1517 just changed the state of lock:
     (clock-AF_INET){++.?..}, at: [<c06aab60>] sock_def_readable+0x20/0x80
    but this lock took another, SOFTIRQ-unsafe lock in the past:
     (slock-AF_INET){+.-...}
    
    and interrupts could create inverse lock ordering between them.
    
    other info that might help us debug this:
    1 lock held by sctp_darn/1517:
     #0:  (sk_lock-AF_INET){+.+.+.}, at: [<cdfe363d>] sctp_sendmsg+0x23d/0xc00 [sctp]
    Signed-off-by: default avatarWei Yongjun <yjwei@cn.fujitsu.com>
    Signed-off-by: default avatarVlad Yasevich <vladislav.yasevich@hp.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    561b1733
endpointola.c 13 KB