Re: [PATCH 1/2] RDMA/core: Untrack resources before driver destroy

Jason Gunthorpe <[email protected]>
Newsgroups org.kernel.vger.linux-rdma,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Tue, Aug 11, 2026 at 06:56:22PM +0800, Yili Zhang wrote:
> From: Yili Zhang <[email protected]>
> 
> When a userspace RDMA object cannot be destroyed by the driver during
> ib_uverbs_close() (e.g. mlx5 destroy_cq/destroy_qp fails because the
> hardware is in a transient error state),

That's a bug in of itself, if the HW is erroring then the destroy
should wait for the error to progress past flr and then let the
destroy continue.

> Fix it by moving rdma_restrack_del() to *before* the driver's destroy
> callback, so the restrack entry is removed at the moment we commit to
> destroying the object rather than only on success.  

No, that messes up legitimate cases where the destroy is allowed to
fail.

AFAICT the issue here is the netlink is not allowed to access the
context without proper locking.

Jason
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.