From mboxrd@z Thu Jan 1 00:00:00 1970 From: ebiederm@xmission.com (Eric W. Biederman) Subject: Re: [PATCH][NETNS] Use list_for_each_entry_continue_reverse in setup_net Date: Fri, 14 Sep 2007 15:53:21 -0600 Message-ID: References: <46EA3AB4.7060904@openvz.org> <20070914144938.3ba643a5@oldman> <20070914220714.3a1e87f8@oldman> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Pavel Emelyanov , Linux Netdev List , Linux Containers , devel@openvz.org, Daniel Lezcano To: Stephen Hemminger Return-path: Received: from ebiederm.dsl.xmission.com ([166.70.28.69]:39623 "EHLO ebiederm.dsl.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753965AbXINVyU (ORCPT ); Fri, 14 Sep 2007 17:54:20 -0400 In-Reply-To: <20070914220714.3a1e87f8@oldman> (Stephen Hemminger's message of "Fri, 14 Sep 2007 22:07:14 +0200") Sender: netdev-owner@vger.kernel.org List-Id: netdev.vger.kernel.org Stephen Hemminger writes: > Could we just make it so dev->init is not allowed to fail? Then it > can be a void function and the nasty unwind code can go? Unfortunately we need to allocate memory, and perform other operations that can fail. That's the nature of the problem. So I think not allowing init to fail would be optimizing for the wrong the case. Allowing init to fail makes the rest of the code simpler because we don't have to perform the impossible when the highly unlikely happens. The ugly unwind is only about 5 lines of code that never need to change (except for beautification). So I don't think the cost is prohibitive. Eric