IB/uverbs: Allow all DESTROY commands to succeed after disassociate
authorJason Gunthorpe <jgg@mellanox.com>
Thu, 26 Jul 2018 03:40:20 +0000 (21:40 -0600)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 1 Aug 2018 20:55:48 +0000 (14:55 -0600)
commit0f50d88a6e9ae6d9dd14ed1a7d6b309280a9c23b
treec0fb171864e582367f1de93f98320ec21a117465
parenta9b66d6453d70ee01f11bdae40d68996cee7474a
IB/uverbs: Allow all DESTROY commands to succeed after disassociate

The disassociate function was broken by design because it failed all
commands. This prevents userspace from calling destroy on a uobject after
it has detected a device fatal error and thus reclaiming the resources in
userspace is prevented.

This fix is now straightforward, when anything destroys a uobject that is
not the user the object remains on the IDR with a NULL context and object
pointer. All lookup locking modes other than DESTROY will fail. When the
user ultimately calls the destroy function it is simply dropped from the
IDR while any related information is returned.

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