• Leon Romanovsky's avatar
    RDMA/core: Postpone uobject cleanup on failure till FD close · efa968ee
    Leon Romanovsky authored
    Remove the ib_is_destroyable_retryable() concept.
    
    The idea here was to allow the drivers to forcibly clean the HW object
    even if they otherwise didn't want to (eg because of usecnt). This was an
    attempt to clean up in a world where drivers were not allowed to fail HW
    object destruction.
    
    Now that we are going back to allowing HW objects to fail destroy this
    doesn't make sense. Instead if a uobject's HW object can't be destroyed it
    is left on the uobject list and it is up to uverbs_destroy_ufile_hw() to
    clean it. Multiple passes over the uobject list allow hidden dependencies
    to be resolved. If that fails the HW driver is broken, throw a WARN_ON and
    leak the HW object memory.
    
    All the other tricky failure paths (eg on creation error unwind) have
    already been updated to this new model.
    
    Link: https://lore.kernel.org/r/20201104144556.3809085-2-leon@kernel.orgSigned-off-by: default avatarLeon Romanovsky <leonro@nvidia.com>
    Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
    efa968ee
uverbs_cmd.c 105 KB