Haggai Eran
31b57b87fd
IB/ucma: Fix lockdep warning in ucma_lock_files
...
The ucma_lock_files() locks the mut mutex on two files, e.g. for migrating
an ID. Use mutex_lock_nested() to prevent the warning below.
=============================================
[ INFO: possible recursive locking detected ]
4.1.0-rc6-hmm+ #40 Tainted: G O
---------------------------------------------
pingpong_rpc_se/10260 is trying to acquire lock:
(&file->mut){+.+.+.}, at: [<ffffffffa047ac55>] ucma_migrate_id+0xc5/0x248 [rdma_ucm]
but task is already holding lock:
(&file->mut){+.+.+.}, at: [<ffffffffa047ac4b>] ucma_migrate_id+0xbb/0x248 [rdma_ucm]
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
----
lock(&file->mut);
lock(&file->mut);
*** DEADLOCK ***
May be due to missing lock nesting notation
1 lock held by pingpong_rpc_se/10260:
#0 : (&file->mut){+.+.+.}, at: [<ffffffffa047ac4b>] ucma_migrate_id+0xbb/0x248 [rdma_ucm]
stack backtrace:
CPU: 0 PID: 10260 Comm: pingpong_rpc_se Tainted: G O 4.1.0-rc6-hmm+ #40
Hardware name: Red Hat KVM, BIOS 0.5.1 01/01/2007
ffff8801f85b63d0 ffff880195677b58 ffffffff81668f49 0000000000000001
ffffffff825cbbe0 ffff880195677c38 ffffffff810bb991 ffff880100000000
ffff880100000000 ffff880100000001 ffff8801f85b7010 ffffffff8121bee9
Call Trace:
[<ffffffff81668f49>] dump_stack+0x4f/0x6e
[<ffffffff810bb991>] __lock_acquire+0x741/0x1820
[<ffffffff8121bee9>] ? dput+0x29/0x320
[<ffffffff810bcb38>] lock_acquire+0xc8/0x240
[<ffffffffa047ac55>] ? ucma_migrate_id+0xc5/0x248 [rdma_ucm]
[<ffffffff8166b901>] ? mutex_lock_nested+0x291/0x3e0
[<ffffffff8166b6d5>] mutex_lock_nested+0x65/0x3e0
[<ffffffffa047ac55>] ? ucma_migrate_id+0xc5/0x248 [rdma_ucm]
[<ffffffff810baeed>] ? trace_hardirqs_on+0xd/0x10
[<ffffffff8166b66e>] ? mutex_unlock+0xe/0x10
[<ffffffffa047ac55>] ucma_migrate_id+0xc5/0x248 [rdma_ucm]
[<ffffffffa0478474>] ucma_write+0xa4/0xb0 [rdma_ucm]
[<ffffffff81200674>] __vfs_write+0x34/0x100
[<ffffffff8112427c>] ? __audit_syscall_entry+0xac/0x110
[<ffffffff810ec055>] ? current_kernel_time+0xc5/0xe0
[<ffffffff812aa4d3>] ? security_file_permission+0x23/0x90
[<ffffffff8120088d>] ? rw_verify_area+0x5d/0xe0
[<ffffffff812009bb>] vfs_write+0xab/0x120
[<ffffffff81201519>] SyS_write+0x59/0xd0
[<ffffffff8112427c>] ? __audit_syscall_entry+0xac/0x110
[<ffffffff8166ffee>] system_call_fastpath+0x12/0x76
Signed-off-by: Haggai Eran <haggaie@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
2015-07-14 13:20:12 -04:00
..
2015-06-02 09:33:13 -04:00
2015-07-14 13:20:08 -04:00
2015-06-12 14:49:18 -04:00
2015-06-02 09:33:13 -04:00
2015-05-05 13:21:27 -04:00
2015-07-14 13:20:09 -04:00
2015-06-23 15:53:26 -07:00
2014-01-19 15:14:04 -08:00
2015-06-12 14:49:17 -04:00
2013-02-27 19:10:24 -08:00
2014-08-05 07:33:24 -07:00
2015-07-14 13:20:10 -04:00
2015-07-14 13:20:10 -04:00
2015-07-14 13:20:10 -04:00
2015-06-12 14:49:18 -04:00
2015-06-12 14:49:18 -04:00
2008-07-14 23:48:44 -07:00
2015-07-14 13:20:08 -04:00
2014-12-15 18:13:36 -08:00
2015-07-14 13:20:08 -04:00
2014-06-10 10:11:45 -07:00
2015-07-14 13:20:08 -04:00
2011-10-31 19:31:35 -04:00
2015-07-14 13:20:08 -04:00
2015-07-14 13:20:08 -04:00
2015-07-14 13:20:08 -04:00
2015-07-14 13:20:08 -04:00
2015-05-18 13:35:05 -04:00
2015-07-14 13:20:12 -04:00
2011-10-31 19:31:35 -04:00
2015-05-05 09:18:02 -04:00
2014-12-15 18:13:36 -08:00
2015-04-15 16:05:02 -04:00
2015-06-12 14:49:18 -04:00
2015-06-12 14:49:10 -04:00
2015-06-12 14:49:10 -04:00
2014-09-22 09:46:52 -07:00
2015-06-12 14:49:10 -04:00
2015-06-12 14:49:10 -04:00