• Y
    tipc: fix a potential deadlock · 7b8613e0
    Ying Xue 提交于
    Locking dependency detected below possible unsafe locking scenario:
    
               CPU0                          CPU1
    T0:  tipc_named_rcv()                tipc_rcv()
    T1:  [grab nametble write lock]*     [grab node lock]*
    T2:  tipc_update_nametbl()           tipc_node_link_up()
    T3:  tipc_nodesub_subscribe()        tipc_nametbl_publish()
    T4:  [grab node lock]*               [grab nametble write lock]*
    
    The opposite order of holding nametbl write lock and node lock on
    above two different paths may result in a deadlock. If we move the
    the updating of the name table after link state named out of node
    lock, the reverse order of holding locks will be eliminated, and
    as a result, the deadlock risk.
    Signed-off-by: NYing Xue <ying.xue@windriver.com>
    Signed-off-by: NJon Maloy <jon.maloy@ericsson.com>
    Signed-off-by: NDavid S. Miller <davem@davemloft.net>
    7b8613e0
node.c 15.7 KB