From patchwork Fri Mar 27 21:14:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Duyck X-Patchwork-Id: 455581 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 35C831400A0 for ; Sat, 28 Mar 2015 08:14:23 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752605AbbC0VOT (ORCPT ); Fri, 27 Mar 2015 17:14:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53127 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752172AbbC0VOR (ORCPT ); Fri, 27 Mar 2015 17:14:17 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 5D9392B649B; Fri, 27 Mar 2015 21:14:17 +0000 (UTC) Received: from [192.168.122.149] (ovpn-112-81.phx2.redhat.com [10.3.112.81]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2RLEGnI011985; Fri, 27 Mar 2015 17:14:16 -0400 Subject: [net-next PATCH 1/2] fib_trie: Fix warning on fib4_rules_exit From: Alexander Duyck To: netdev@vger.kernel.org Cc: Cong Wang , davem@davemloft.net Date: Fri, 27 Mar 2015 14:14:16 -0700 Message-ID: <20150327211416.2465.23170.stgit@ahduyck-vm-fedora22> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This fixes the following warning: BUG: sleeping function called from invalid context at mm/slub.c:1268 in_atomic(): 1, irqs_disabled(): 0, pid: 6, name: kworker/u8:0 INFO: lockdep is turned off. CPU: 3 PID: 6 Comm: kworker/u8:0 Tainted: G W 4.0.0-rc5+ #895 Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 Workqueue: netns cleanup_net 0000000000000006 ffff88011953fa68 ffffffff81a203b6 000000002c3a2c39 ffff88011952a680 ffff88011953fa98 ffffffff8109daf0 ffff8801186c6aa8 ffffffff81fbc9e5 00000000000004f4 0000000000000000 ffff88011953fac8 Call Trace: [] dump_stack+0x4c/0x65 [] ___might_sleep+0x1c3/0x1cb [] __might_sleep+0x78/0x80 [] slab_pre_alloc_hook+0x31/0x8f [] __kmalloc+0x69/0x14e [] ? kzalloc.constprop.20+0xe/0x10 [] kzalloc.constprop.20+0xe/0x10 [] fib_trie_table+0x27/0x8b [] fib_trie_unmerge+0x37/0x2a6 [] ? arch_local_irq_save+0x9/0xc [] fib_unmerge+0x2d/0xb3 [] fib4_rule_delete+0x1f/0x52 [] ? fib_rules_unregister+0x30/0xb2 [] fib_rules_unregister+0x7c/0xb2 [] fib4_rules_exit+0x15/0x18 [] ip_fib_net_exit+0x23/0xf2 [] fib_net_exit+0x32/0x36 [] ops_exit_list+0x45/0x57 [] cleanup_net+0x13c/0x1cd [] process_one_work+0x255/0x4ad [] ? process_one_work+0x161/0x4ad [] worker_thread+0x1cd/0x2ab [] ? process_scheduled_works+0x2f/0x2f [] kthread+0xd4/0xdc [] ? local_clock+0x19/0x22 [] ? __kthread_parkme+0x83/0x83 [] ret_from_fork+0x58/0x90 [] ? __kthread_parkme+0x83/0x83 The issue was that as a part of exiting the default rules were being deleted which resulted in the local trie being unmerged. By moving the freeing of the FIB tables up we can avoid the unmerge since there is no local table left when we call the fib4_rules_exit function. Fixes: 0ddcf43d5d4a ("ipv4: FIB Local/MAIN table collapse") Reported-by: Cong Wang Signed-off-by: Alexander Duyck --- net/ipv4/fib_frontend.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index e5b6b0534c5f..767120111d90 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c @@ -1176,10 +1176,6 @@ static void ip_fib_net_exit(struct net *net) rtnl_lock(); -#ifdef CONFIG_IP_MULTIPLE_TABLES - fib4_rules_exit(net); -#endif - for (i = 0; i < FIB_TABLE_HASHSZ; i++) { struct hlist_head *head = &net->ipv4.fib_table_hash[i]; struct hlist_node *tmp; @@ -1212,6 +1208,10 @@ static void ip_fib_net_exit(struct net *net) fib_free_table(tb); } } + +#ifdef CONFIG_IP_MULTIPLE_TABLES + fib4_rules_exit(net); +#endif rtnl_unlock(); kfree(net->ipv4.fib_table_hash); }