[PATCH 4/7] cxlflash: Simplify attach path error cleanup

Uma Krishnan ukrishn at linux.vnet.ibm.com
Wed Mar 9 04:55:44 AEDT 2016


On 3/4/2016 3:55 PM, Uma Krishnan wrote:
> From: "Matthew R. Ochs" <mrochs at linux.vnet.ibm.com>
>
> 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: Matthew R. Ochs <mrochs at linux.vnet.ibm.com>

Reviewed-by: Uma Krishnan <ukrishn at linux.vnet.ibm.com>



More information about the Linuxppc-dev mailing list