[ofa-general] Re: [PATCH v2] ipoib: fix a deadlock between ipoib start/stop and child interface create/delete

Yossi Etigin yosefe at Voltaire.COM
Mon Mar 30 09:52:37 PDT 2009


Roland Dreier wrote:
> @@ -162,10 +165,11 @@ int ipoib_vlan_delete(struct net_device *pdev, unsigned short pkey)
>  
>  	ppriv = netdev_priv(pdev);
>  
> +	rtnl_lock();
>  	mutex_lock(&ppriv->vlan_mutex);
>  	list_for_each_entry_safe(priv, tpriv, &ppriv->child_intfs, list) {
>  		if (priv->pkey == pkey) {
> -			unregister_netdev(priv->dev);
> +			unregister_netdevice(priv->dev);
>  			ipoib_dev_cleanup(priv->dev);
>  			list_del(&priv->list);
>  			free_netdev(priv->dev);


I got a kernel bug  and I think it's related to that patch - 
doing free_netdev() asserts the device state to be NETREG_UNREGISTERED, 
and unregister_netdev() does not really cause a state change until rtnl
is unlocked.


kernel BUG at net/core/dev.c:4746!
invalid opcode: 0000 [#2] SMP 
last sysfs file: /sys/class/net/ib0/delete_child
CPU 1 
Modules linked in: rdma_ucm ib_ucm rdma_cm iw_cm ib_addr ib_ipoib ib_cm ib_sa inet_lro ib_uverbs ib_umad mlx4_ib mlx4_core ib_mthca ib_mad ib_core nfs lockd nfs_acl auth_rpcgss sunrpc bonding af_packet ipv6 button battery ac loop dm_mod tg3 libphy forcedeth parport_pc lp parport ext3 jbd edd fan thermal processor thermal_sys amd74xx ide_gd_mod ide_core [last unloaded: mlx4_core]
Pid: 15079, comm: bash Tainted: G      D    2.6.29-rc2-smp #23
RIP: 0010:[<ffffffff803ce7f1>]  [<ffffffff803ce7f1>] free_netdev+0x64/0x81
RSP: 0000:ffff8800ba82be48  EFLAGS: 00010297
RAX: 0000000000000002 RBX: ffff8800b98b2000 RCX: ffff8800b98b2060
RDX: ffff8800b98b2060 RSI: 0000000000000003 RDI: ffff8800b98b2028
RBP: ffff8800b98b2028 R08: ffff8800b98b2000 R09: ffff880001101c80
R10: 0000000000000002 R11: 0000000000000000 R12: ffff8800c7d16700
R13: ffff8800c7d16770 R14: 000000000000faaa R15: ffffffff8059e290
FS:  00007f806b4306d0(0000) GS:ffff8800cf663340(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 00000000005a9008 CR3: 00000000b0111000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff4ff0 DR7: 0000000000000400
Process bash (pid: 15079, threadinfo ffff8800ba82a000, task ffff8800cd4e31a0)
Stack:
 ffff8800b98b3088 0000000000000000 ffff8800b98b3088 ffffffffa0222447
 ffff8800c7d163e8 0000000000000007 ffff8800cb6bbaf0 00000000ffffffed
 ffff8800c7d16478 ffffffffa021c1a1 00007f806abf4000 ffff8800ce805cc0
Call Trace:
 [<ffffffffa0222447>] ? ipoib_vlan_delete+0x67/0xec [ib_ipoib]
 [<ffffffffa021c1a1>] ? delete_child+0x40/0x5d [ib_ipoib]
 [<ffffffff802e7528>] ? sysfs_write_file+0xd2/0x110
 [<ffffffff8029e536>] ? vfs_write+0xad/0x136
 [<ffffffff8029ea53>] ? sys_write+0x45/0x6e
 [<ffffffff8020bedb>] ? system_call_fastpath+0x16/0x1b
Code: ed 38 48 39 c2 75 e3 8b 83 b0 03 00 00 85 c0 75 15 0f b7 83 68 01 00 00 48 29 c3 58 48 89 df 5b 5d e9 04 b6 ec ff 83 f8 03 74 04 <0f> 0b eb fe c7 83 b0 03 00 00 04 00 00 00 48 8d bb e8 03 00 00 
RIP  [<ffffffff803ce7f1>] free_netdev+0x64/0x81
 RSP <ffff8800ba82be48>
---[ end trace 14a605f15a1101d0 ]---


-- 
--Yossi



More information about the general mailing list