From mboxrd@z Thu Jan 1 00:00:00 1970 From: ebiederm@xmission.com (Eric W. Biederman) Subject: Re: [Patch net] rtnetlink: call rtnl_lock_unregistering() in rtnl_link_unregister() Date: Fri, 09 May 2014 16:05:27 -0700 Message-ID: <87bnv6lfig.fsf@x220.int.ebiederm.org> References: <1399657653-4909-1-git-send-email-xiyou.wangcong@gmail.com> <20140509110345.417d2b90@nehalam.linuxnetplumber.net> <20140509120241.3b628dc1@nehalam.linuxnetplumber.net> Mime-Version: 1.0 Content-Type: text/plain Cc: Stephen Hemminger , Linux Kernel Network Developers , "David S. Miller" , Cong Wang To: Cong Wang Return-path: Received: from out02.mta.xmission.com ([166.70.13.232]:55312 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756295AbaEIXGL (ORCPT ); Fri, 9 May 2014 19:06:11 -0400 In-Reply-To: (Cong Wang's message of "Fri, 9 May 2014 12:22:14 -0700") Sender: netdev-owner@vger.kernel.org List-ID: Cong Wang writes: > On Fri, May 9, 2014 at 12:02 PM, Stephen Hemminger > wrote: >> On Fri, 9 May 2014 11:10:36 -0700 >> Cong Wang wrote: >> >>> >>> This can't be done without a macro (at least for me). Or >>> we have to duplicate the code. >> >> macro method is too ugly, figure out a better way. > > That's what I am going to do for -net-next. This patch is for -net, > it's an ugly but minimum change I can find. > > Of course, if you insist we should clean up it for -net as well, > I can do that. It would be no worse to rename the existing function rtnl_lock_unregistering_list And add a second function rtnl_lock_unregistering that does the same thing but uses the global list. Of course this begs the question what happens if the network device we want to destroy is a network namespace that is currently exiting and not on the global list. It looks like we need to grab the net_mutex to get a state where network namespaces are not exiting... Eric