From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161343AbcIWS4q (ORCPT ); Fri, 23 Sep 2016 14:56:46 -0400 Received: from out02.mta.xmission.com ([166.70.13.232]:58749 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758972AbcIWS4n (ORCPT ); Fri, 23 Sep 2016 14:56:43 -0400 From: ebiederm@xmission.com (Eric W. Biederman) To: Arnd Bergmann Cc: "David S. Miller" , WANG Cong , netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20160923160650.3631870-1-arnd@arndb.de> Date: Fri, 23 Sep 2016 13:42:59 -0500 In-Reply-To: <20160923160650.3631870-1-arnd@arndb.de> (Arnd Bergmann's message of "Fri, 23 Sep 2016 18:06:12 +0200") Message-ID: <87y42i8nkc.fsf@x220.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1bnVeL-0005EU-6A;;;mid=<87y42i8nkc.fsf@x220.int.ebiederm.org>;;;hst=in01.mta.xmission.com;;;ip=97.119.97.64;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1+uF/k+DYZzwCU1c27pd9FmS8m0IEsdBMs= X-SA-Exim-Connect-IP: 97.119.97.64 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.7 XMSubLong Long Subject * 0.0 TVD_RCVD_IP Message was received from an IP address * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa07 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject * 0.0 T_TooManySym_03 6+ unique symbols in subject * 0.1 XMSolicitRefs_0 Weightloss drug * 0.0 T_TooManySym_02 5+ unique symbols in subject X-Spam-DCC: XMission; sa07 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Arnd Bergmann X-Spam-Relay-Country: X-Spam-Timing: total 194 ms - load_scoreonly_sql: 0.04 (0.0%), signal_user_changed: 3.4 (1.8%), b_tie_ro: 2.3 (1.2%), parse: 1.03 (0.5%), extract_message_metadata: 13 (6.5%), get_uri_detail_list: 1.72 (0.9%), tests_pri_-1000: 4.7 (2.4%), tests_pri_-950: 1.14 (0.6%), tests_pri_-900: 0.95 (0.5%), tests_pri_-400: 21 (11.0%), check_bayes: 20 (10.5%), b_tokenize: 6 (3.0%), b_tok_get_all: 8 (3.9%), b_comp_prob: 1.74 (0.9%), b_tok_touch_all: 3.1 (1.6%), b_finish: 0.69 (0.4%), tests_pri_0: 139 (71.8%), check_dkim_signature: 0.45 (0.2%), check_dkim_adsp: 2.7 (1.4%), tests_pri_500: 6 (3.3%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH] netns: move {inc,dec}_net_namespaces into #ifdef X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Arnd Bergmann writes: > With the newly enforced limit on the number of namespaces, > we get a build warning if CONFIG_NETNS is disabled: > > net/core/net_namespace.c:273:13: error: 'dec_net_namespaces' defined but not used [-Werror=unused-function] > net/core/net_namespace.c:268:24: error: 'inc_net_namespaces' defined but not used [-Werror=unused-function] > > This moves the two added functions inside the #ifdef that guards > their callers. > > Fixes: 703286608a22 ("netns: Add a limit on the number of net namespaces") > Signed-off-by: Arnd Bergmann Applied to my namespace tree thanks. This was a hold over from calling those functions in a different location. Eric > --- > net/core/net_namespace.c | 20 ++++++++++---------- > 1 file changed, 10 insertions(+), 10 deletions(-) > > diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c > index d0eb13d3226b..989434f36f96 100644 > --- a/net/core/net_namespace.c > +++ b/net/core/net_namespace.c > @@ -265,16 +265,6 @@ struct net *get_net_ns_by_id(struct net *net, int id) > return peer; > } > > -static struct ucounts *inc_net_namespaces(struct user_namespace *ns) > -{ > - return inc_ucount(ns, current_euid(), UCOUNT_NET_NAMESPACES); > -} > - > -static void dec_net_namespaces(struct ucounts *ucounts) > -{ > - dec_ucount(ucounts, UCOUNT_NET_NAMESPACES); > -} > - > /* > * setup_net runs the initializers for the network namespace object. > */ > @@ -319,6 +309,16 @@ static __net_init int setup_net(struct net *net, struct user_namespace *user_ns) > > > #ifdef CONFIG_NET_NS > +static struct ucounts *inc_net_namespaces(struct user_namespace *ns) > +{ > + return inc_ucount(ns, current_euid(), UCOUNT_NET_NAMESPACES); > +} > + > +static void dec_net_namespaces(struct ucounts *ucounts) > +{ > + dec_ucount(ucounts, UCOUNT_NET_NAMESPACES); > +} > + > static struct kmem_cache *net_cachep; > static struct workqueue_struct *netns_wq;