Re: [PATCH rdma-rc v2] RDMA/core: Simplify addition of restrack object

From: Jason Gunthorpe
Date: Mon Jun 28 2021 - 08:59:34 EST


On Mon, Jun 28, 2021 at 08:22:45AM +0300, Leon Romanovsky wrote:
> > The previous code didn't call restrack_del. restrack_del undoes the
> > restrack_set_name stuff, not just add - so it does not leave things
> > back the way it found them
>
> The previous code didn't call to restrack_add and this is why it didn't
> call to restrack_del later. In old and new code, we are still calling to
> acquire and release dev (cma_acquire_dev_by_src_ip/cma_release_dev) and
> this is where the CM_ID is actually attached.

Which is my point, you can't call restrack_del anyplace except the
final destroy. It cannot be used for error unwinding in these kinds of
functions

Jason