From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from e38.co.us.ibm.com (e38.co.us.ibm.com [32.97.110.159]) (using TLSv1.2 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id AA8021A0B8D for ; Wed, 9 Mar 2016 04:55:49 +1100 (AEDT) Received: from localhost by e38.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 8 Mar 2016 10:55:47 -0700 Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id D29AF1FF0023 for ; Tue, 8 Mar 2016 10:43:54 -0700 (MST) Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u28HtjR629163646 for ; Tue, 8 Mar 2016 10:55:45 -0700 Received: from d03av01.boulder.ibm.com (localhost [127.0.0.1]) by d03av01.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u28Htgen022943 for ; Tue, 8 Mar 2016 10:55:43 -0700 Subject: Re: [PATCH 4/7] cxlflash: Simplify attach path error cleanup To: linux-scsi@vger.kernel.org, James Bottomley , "Martin K. Petersen" , "Matthew R. Ochs" , "Manoj N. Kumar" References: <1457128424-53017-1-git-send-email-ukrishn@linux.vnet.ibm.com> <1457128520-53056-1-git-send-email-ukrishn@linux.vnet.ibm.com> <1457128520-53056-4-git-send-email-ukrishn@linux.vnet.ibm.com> Cc: linuxppc-dev@lists.ozlabs.org, Brian King , Ian Munsie , Andrew Donnellan , Frederic Barrat , Christophe Lombard From: Uma Krishnan Message-ID: <56DF1220.9010000@linux.vnet.ibm.com> Date: Tue, 8 Mar 2016 11:55:44 -0600 MIME-Version: 1.0 In-Reply-To: <1457128520-53056-4-git-send-email-ukrishn@linux.vnet.ibm.com> Content-Type: text/plain; charset=windows-1252; format=flowed List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 3/4/2016 3:55 PM, Uma Krishnan wrote: > From: "Matthew R. Ochs" > > 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 Reviewed-by: Uma Krishnan