Commit 50704e03 authored by Leon Romanovsky's avatar Leon Romanovsky Committed by Jason Gunthorpe

RDMA/umem: Restore lockdep check while downgrading lock

Lockdep engine handles correctly downgrade of locks and it simply
incorrect to disable lockdep checks prior to calling mmu_notifier.

Remove lockdep_off and ensure locks correctness.
Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent e1f540c3
...@@ -431,13 +431,7 @@ int ib_umem_odp_get(struct ib_ucontext *context, struct ib_umem *umem, ...@@ -431,13 +431,7 @@ int ib_umem_odp_get(struct ib_ucontext *context, struct ib_umem *umem,
atomic_set(&context->notifier_count, 0); atomic_set(&context->notifier_count, 0);
INIT_HLIST_NODE(&context->mn.hlist); INIT_HLIST_NODE(&context->mn.hlist);
context->mn.ops = &ib_umem_notifiers; context->mn.ops = &ib_umem_notifiers;
/*
* Lock-dep detects a false positive for mmap_sem vs.
* umem_rwsem, due to not grasping downgrade_write correctly.
*/
lockdep_off();
ret_val = mmu_notifier_register(&context->mn, mm); ret_val = mmu_notifier_register(&context->mn, mm);
lockdep_on();
if (ret_val) { if (ret_val) {
pr_err("Failed to register mmu_notifier %d\n", ret_val); pr_err("Failed to register mmu_notifier %d\n", ret_val);
ret_val = -EBUSY; ret_val = -EBUSY;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment