From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: [PATCH] bonding: lockdep annotation Date: Thu, 28 Sep 2006 11:42:41 +0200 Message-ID: <1159436561.28131.37.camel@taijtu> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: Andrew Morton , Ingo Molnar , "John W. Linville" , Chad Tindel , Jay Vosburgh Return-path: Received: from amsfep17-int.chello.nl ([213.46.243.15]:31628 "EHLO amsfep20-int.chello.nl") by vger.kernel.org with ESMTP id S1751811AbWI1JnK (ORCPT ); Thu, 28 Sep 2006 05:43:10 -0400 To: linux-kernel , netdev Sender: netdev-owner@vger.kernel.org List-Id: netdev.vger.kernel.org ============================================= [ INFO: possible recursive locking detected ] 2.6.17-1.2600.fc6 #1 --------------------------------------------- ifconfig/2411 is trying to acquire lock: (&dev->_xmit_lock){-...}, at: [] dev_mc_add+0x45/0x15f but task is already holding lock: (&dev->_xmit_lock){-...}, at: [] dev_mc_add+0x45/0x15f other info that might help us debug this: 3 locks held by ifconfig/2411: #0: (rtnl_mutex){--..}, at: [] mutex_lock+0x2a/0x2e #1: (&dev->_xmit_lock){-...}, at: [] dev_mc_add+0x45/0x15f #2: (&bond->lock){-.-+}, at: [] bond_set_multicast_list+0x2c/0x26a [bonding] stack backtrace: Call Trace: [] show_trace+0xae/0x319 [] dump_stack+0x15/0x17 [] __lock_acquire+0x135/0xa64 [] lock_acquire+0x4b/0x69 [] _spin_lock_bh+0x2a/0x36 [] dev_mc_add+0x45/0x15f [] :bonding:bond_set_multicast_list+0x138/0x26a [] __dev_mc_upload+0x22/0x24 [] dev_mc_add+0x11a/0x15f [] igmp_group_added+0x55/0x10f [] ip_mc_inc_group+0x1d6/0x21a [] ip_mc_up+0x46/0x61 [] inetdev_init+0x11c/0x136 [] devinet_ioctl+0x3eb/0x5e9 [] inet_ioctl+0x71/0x8f [] sock_ioctl+0x1e8/0x20a [] do_ioctl+0x2a/0x77 [] vfs_ioctl+0x25a/0x277 [] sys_ioctl+0x5f/0x82 [] system_call+0x7e/0x83 The bonding driver nests other drivers, give the bonding driver its own lock class. Signed-off-by: Peter Zijlstra Acked-by: Ingo Molnar --- diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 0fb5f65..ebbf002 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -4692,6 +4692,8 @@ static int bond_check_params(struct bond return 0; } +static struct lock_class_key bonding_netdev_xmit_lock_key; + /* Create a new bond based on the specified name and bonding parameters. * Caller must NOT hold rtnl_lock; we need to release it here before we * set up our sysfs entries. @@ -4727,6 +4729,9 @@ int bond_create(char *name, struct bond_ if (res < 0) { goto out_bond; } + + lockdep_set_class(&bond_dev->_xmit_lock, &bonding_netdev_xmit_lock_key); + if (newbond) *newbond = bond_dev->priv;