]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/restrack: don't use uaccess_kernel()
authorSteve Wise <swise@opengridcomputing.com>
Thu, 15 Feb 2018 02:43:36 +0000 (18:43 -0800)
committerJason Gunthorpe <jgg@mellanox.com>
Fri, 16 Feb 2018 17:18:11 +0000 (10:18 -0700)
commitf86b542ac11dd222b0d3ac36ed016a556646468c
tree204e7fec71004dbca9041601d93f8b770bb3d576
parentecd935b9840bb82789f880c9ffd0d428403a51db
RDMA/restrack: don't use uaccess_kernel()

uaccess_kernel() isn't sufficient to determine if an rdma resource is
user-mode or not.  For example, resources allocated in the add_one()
function of an ib_client get falsely labeled as user mode, when they
are kernel mode allocations.  EG: mad qps.

The result is that these qps are skipped over during a nldev query
because of an erroneous namespace mismatch.

So now we determine if the resource is user-mode by looking at the object
struct's uobject or similar pointer to know if it was allocated for user
mode applications.

Fixes: ed479f0ebb30 ("RDMA/restrack: Add general infrastructure to track RDMA resources")
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/core_priv.h
drivers/infiniband/core/restrack.c
drivers/infiniband/core/uverbs_cmd.c
drivers/infiniband/core/verbs.c