• Matthew R. Ochs's avatar
    cxlflash: Simplify attach path error cleanup · 8a96b52a
    Matthew R. Ochs authored
    The cxlflash_disk_attach() routine currently uses a cascading error
    gate strategy for its error cleanup path. While this strategy is
    commonly used to handle cleanup scenarios, it is too restrictive when
    function callouts need to be restructured. Problems range from
    inserting error path bugs in previously 'good' code to the cleanup
    path imposing design changes to how the normal path is structured.
    A less restrictive approach is needed to support ordering changes
    that come about when operating in different environments.
    
    To overcome this restriction, the error cleanup path is modified to
    have a single entrypoint and use conditional logic to cleanup where
    necessary. Entities that require multiple cleanup steps must be
    carefully vetted to ensure their APIs support state. In cases where
    they do not (none as of this commit) additional local variables can
    be used to maintain state on their behalf.
    Signed-off-by: default avatarMatthew R. Ochs <mrochs@linux.vnet.ibm.com>
    Reviewed-by: default avatarUma Krishnan <ukrishn@linux.vnet.ibm.com>
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    8a96b52a
superpipe.c 59.7 KB