aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2018-07-25 21:40:16 -0600
committerJason Gunthorpe <jgg@mellanox.com>2018-08-01 14:55:48 -0600
commitcc2e14e68004e6dec70842f990085f67c1f6fec7 (patch)
treedede1f553f6725ab52071442f422fd36a170acf9 /drivers/infiniband/core
parentIB/uverbs: Allow uobject allocation to work concurrently with disassociate (diff)
downloadlinux-dev-cc2e14e68004e6dec70842f990085f67c1f6fec7.tar.xz
linux-dev-cc2e14e68004e6dec70842f990085f67c1f6fec7.zip
IB/uverbs: Lower the test for ongoing disassociation
Commands that are reading/writing to objects can test for an ongoing disassociation during their initial call to rdma_lookup_get_uobject. This directly prevents all of these commands from conflicting with an ongoing disassociation. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/core')
-rw-r--r--drivers/infiniband/core/rdma_core.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/infiniband/core/rdma_core.c b/drivers/infiniband/core/rdma_core.c
index 95a8110f186f..d4de1fed98f2 100644
--- a/drivers/infiniband/core/rdma_core.c
+++ b/drivers/infiniband/core/rdma_core.c
@@ -449,6 +449,17 @@ struct ib_uobject *rdma_lookup_get_uobject(const struct uverbs_obj_type *type,
goto free;
}
+ /*
+ * If we have been disassociated block every command except for
+ * DESTROY based commands.
+ */
+ if (mode != UVERBS_LOOKUP_DESTROY &&
+ !srcu_dereference(ufile->device->ib_dev,
+ &ufile->device->disassociate_srcu)) {
+ ret = -EIO;
+ goto free;
+ }
+
ret = uverbs_try_lock_object(uobj, mode);
if (ret)
goto free;