From: Peter Zijlstra ============================================= [ 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 Cc: Stephen Hemminger Signed-off-by: Andrew Morton --- drivers/net/bonding/bond_main.c | 5 +++++ 1 files changed, 5 insertions(+) diff -puN drivers/net/bonding/bond_main.c~bonding-lockdep-annotation drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c~bonding-lockdep-annotation +++ a/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; _