Skip to content

Commit ddea788

Browse files
lxindavem330
authored andcommitted
bonding: do not set slave_dev npinfo before slave_enable_netpoll in bond_enslave
After Commit 8a8efa2 ("bonding: sync netpoll code with bridge"), it would set slave_dev npinfo in slave_enable_netpoll when enslaving a dev if bond->dev->npinfo was set. However now slave_dev npinfo is set with bond->dev->npinfo before calling slave_enable_netpoll. With slave_dev npinfo set, __netpoll_setup called in slave_enable_netpoll will not call slave dev's .ndo_netpoll_setup(). It causes that the lower dev of this slave dev can't set its npinfo. One way to reproduce it: # modprobe bonding # brctl addbr br0 # brctl addif br0 eth1 # ifconfig bond0 192.168.122.1/24 up # ifenslave bond0 eth2 # systemctl restart netconsole # ifenslave bond0 br0 # ifconfig eth2 down # systemctl restart netconsole The netpoll won't really work. This patch is to remove that slave_dev npinfo setting in bond_enslave(). Fixes: 8a8efa2 ("bonding: sync netpoll code with bridge") Signed-off-by: Xin Long <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 7e5a206 commit ddea788

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/net/bonding/bond_main.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,8 +1660,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,
16601660
} /* switch(bond_mode) */
16611661

16621662
#ifdef CONFIG_NET_POLL_CONTROLLER
1663-
slave_dev->npinfo = bond->dev->npinfo;
1664-
if (slave_dev->npinfo) {
1663+
if (bond->dev->npinfo) {
16651664
if (slave_enable_netpoll(new_slave)) {
16661665
netdev_info(bond_dev, "master_dev is using netpoll, but new slave device does not support netpoll\n");
16671666
res = -EBUSY;

0 commit comments

Comments
 (0)