OSDN Git Service

RDMA/core: Change how failing destroy is handled during uobj abort
authorJason Gunthorpe <jgg@nvidia.com>
Wed, 2 Sep 2020 08:17:08 +0000 (11:17 +0300)
committerJason Gunthorpe <jgg@nvidia.com>
Wed, 9 Sep 2020 16:16:48 +0000 (13:16 -0300)
commitf553246f7f794675da1794ae7ee07d1f35e561ae
treeb278760fd3a2faf7f807b8fe1168731903406d0d
parent00b3c11879d790f51cac6477abe870936a2323ae
RDMA/core: Change how failing destroy is handled during uobj abort

Currently it triggers a WARN_ON and then goes ahead and destroys the
uobject anyhow, leaking any driver memory.

The only place that leaks driver memory should be during FD close() in
uverbs_destroy_ufile_hw().

Drivers are only allowed to fail destroy uobjects if they guarantee
destroy will eventually succeed. uverbs_destroy_ufile_hw() provides the
loop to give the driver that chance.

Link: https://lore.kernel.org/r/20200902081708.746631-1-leon@kernel.org
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/core/rdma_core.c
include/rdma/ib_verbs.h