IB/uverbs: Allow RDMA_REMOVE_DESTROY to work concurrently with disassociate
authorJason Gunthorpe <jgg@mellanox.com>
Thu, 26 Jul 2018 03:40:14 +0000 (21:40 -0600)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 1 Aug 2018 20:55:48 +0000 (14:55 -0600)
commit7452a3c745a2e7eb70d09dc5bb870759b1f26c91
tree6299209a46563a69fba8408baf3184f0e0d8df91
parent9867f5c6695f0a17cde9a4dc140fe026b4e40d4a
IB/uverbs: Allow RDMA_REMOVE_DESTROY to work concurrently with disassociate

After all the recent structural changes this is now straightfoward, hoist
the hw_destroy_rwsem up out of rdma_destroy_explicit and wrap it around
the uobject write lock as well as the destroy.

This is necessary as obtaining a write lock concurrently with
uverbs_destroy_ufile_hw() will cause malfunction.

After this change none of the destroy callbacks require the
disassociate_srcu lock to be correct.

This requires introducing a new lookup mode, UVERBS_LOOKUP_DESTROY as the
IOCTL interface needs to hold an unlocked kref until all command
verification is completed.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/rdma_core.c
drivers/infiniband/core/rdma_core.h
drivers/infiniband/core/uverbs_ioctl.c
include/rdma/uverbs_types.h