]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/umem: Handle a half-complete start/end sequence
authorJason Gunthorpe <jgg@mellanox.com>
Sun, 16 Sep 2018 17:48:10 +0000 (20:48 +0300)
committerDoug Ledford <dledford@redhat.com>
Fri, 21 Sep 2018 15:58:36 +0000 (11:58 -0400)
commitdce2092ec013ec68d49dc2e00b88d20a0fde3e52
tree4169879247114dbfd027d0da322fc6f1dbf4c82e
parent878224ec2d28ee5af910c7d4ab9d475e968f8428
RDMA/umem: Handle a half-complete start/end sequence

mmu_notifier_unregister() can race between a invalidate_start/end and
cause the invalidate_end to be skipped. This causes an imbalance in the
locking, which lockdep complains about.

This is not actually a bug, as we immediately kfree the memory holding the
lock, but it simple enough to fix.

Mark when the notifier is being destroyed and abort the start callback.
This can be done under the lock we already obtained, and can re-purpose
the invalidate_range test we already have.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/umem_odp.c
include/rdma/ib_umem_odp.h