From: Ying X. <yin...@wi...> - 2012-09-26 08:21:05
|
Add lock nesting notation to quiet the following lockdep warning: [ INFO: possible recursive locking detected ] --------------------------------------------- kworker/u:0/6 is trying to acquire lock: (sk_lock-AF_TIPC){+.+.+.}, at: [<c8c1226c>] accept+0x15c/0x310 [tipc] but task is already holding lock: (sk_lock-AF_TIPC){+.+.+.}, at: [<c8c12138>] accept+0x28/0x310 [tipc] other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(sk_lock-AF_TIPC); lock(sk_lock-AF_TIPC); *** DEADLOCK *** May be due to missing lock nesting notation 3 locks held by kworker/u:0/6: stack backtrace: Pid: 6, comm: kworker/u:0 Not tainted 3.5.0+ #25 Call Trace: [<c1092883>] print_deadlock_bug+0xe3/0xf0 [<c1094472>] validate_chain+0x5b2/0x720 [<c109485a>] __lock_acquire+0x27a/0x460 [<c1094ad0>] lock_acquire+0x90/0x100 [<c8c1226c>] ? accept+0x15c/0x310 [tipc] [<c1489d10>] lock_sock_nested+0x70/0x90 [<c8c1226c>] ? accept+0x15c/0x310 [tipc] [<c8c1226c>] accept+0x15c/0x310 [tipc] [<c1587962>] ? _raw_spin_unlock+0x22/0x30 [<c1486f51>] ? sock_create_lite+0x71/0x90 [<c1486fbb>] kernel_accept+0x4b/0x90 [<c8c13619>] tipc_accept_from_sock+0x29/0xa0 [tipc] [<c8c13115>] tipc_recv_work+0x15/0x30 [tipc] [<c1054c6c>] process_one_work+0x1cc/0x4a0 [<c1054bf0>] ? process_one_work+0x150/0x4a0 [<c8c13100>] ? tipc_close_conn+0xa0/0xa0 [tipc] [<c1056c92>] worker_thread+0x102/0x350 [<c109382b>] ? trace_hardirqs_on+0xb/0x10 [<c1056b90>] ? manage_workers+0x100/0x100 [<c105b614>] kthread+0x84/0x90 [<c105b590>] ? __init_kthread_worker+0x60/0x60 [<c158ed62>] kernel_thread_helper+0x6/0x10 Signed-off-by: Ying Xue <yin...@wi...> --- net/tipc/socket.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 2a5ccdf..6395560 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c @@ -1510,7 +1510,7 @@ static int accept(struct socket *sock, struct socket *new_sock, int flags) u32 new_ref = new_tport->ref; struct tipc_msg *msg = buf_msg(buf); - lock_sock(new_sk); + lock_sock_nested(new_sk, SINGLE_DEPTH_NESTING); /* * Reject any stray messages received by new socket -- 1.7.1 |