From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kumar amit mehta Subject: Re: [PATCH] dm-lc.c: Audit return values of functions invoked in module init routine Date: Tue, 30 Jul 2013 22:53:45 -0400 Message-ID: <20130731025345.GA25441@gmail.com> References: <1375212580-6934-1-git-send-email-gmate.amit@gmail.com> <51F8C650.4080200@gmail.com> Reply-To: device-mapper development Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <51F8C650.4080200@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: Akira Hayakawa Cc: dm-devel@redhat.com List-Id: dm-devel.ids On Wed, Jul 31, 2013 at 05:09:52PM +0900, Akira Hayakawa wrote: > What if registering lc_mgr_target failed > after registering lc_target succeeded? > I think we should unregister the lc_target in this case. > Am I wrong? You are correct. I'll make the changes. > Looking for some code samples, > dm-snap.c and dm-thin.c have more than two targets to register > like dm-lc does. > > Below is a code fragment from dm-snap.c . > It treats each failure in registering targets > independently with different labels. > > // dm-snap.c > bad_exception_cache: > exit_origin_hash(); > bad_origin_hash: > dm_unregister_target(&merge_target); > bad_register_merge_target: > dm_unregister_target(&origin_target); > bad_register_origin_target: > dm_unregister_target(&snapshot_target); > bad_register_snapshot_target: > dm_exception_store_exit(); > > return r; Thank you for your feedback and the pointers, I'll resend the patch. !!amit