]> git.baikalelectronics.ru Git - kernel.git/commit
IB/uverbs: Hold the uobj write lock after allocate
authorJason Gunthorpe <jgg@mellanox.com>
Tue, 13 Feb 2018 10:18:36 +0000 (12:18 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Thu, 15 Feb 2018 21:59:46 +0000 (14:59 -0700)
commitdac2f115902114c33ce54ae028810afab8896111
tree65f2a21bdbfc8171e89f8e656d1a8c0d416702de
parent08c1f40d09a86b71d33426bdf04c91ebcfe2c6ad
IB/uverbs: Hold the uobj write lock after allocate

This clarifies the design intention that time between allocate and
commit has the uobj exclusive to the caller. We already guarantee
this by delaying publishing the uobj pointer via idr_insert,
fd_install, list_add, etc.

Additionally holding the usecnt lock during this period provides
extra clarity and more protection against future mistakes.

Fixes: 64b9060fbcb0 ("IB/core: Add support for idr types")
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/rdma_core.c