Commit 93b2d4a2 authored by David S. Miller's avatar David S. Miller

Revert "[RTNETLINK]: Send a single notification on device state changes."

This reverts commit 45b50354.

It break locking around dev->link_mode as well as cause
other bootup problems.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b57dfbc4
...@@ -504,7 +504,7 @@ int rtnl_put_cacheinfo(struct sk_buff *skb, struct dst_entry *dst, u32 id, ...@@ -504,7 +504,7 @@ int rtnl_put_cacheinfo(struct sk_buff *skb, struct dst_entry *dst, u32 id,
EXPORT_SYMBOL_GPL(rtnl_put_cacheinfo); EXPORT_SYMBOL_GPL(rtnl_put_cacheinfo);
static int set_operstate(struct net_device *dev, unsigned char transition, bool send_notification) static void set_operstate(struct net_device *dev, unsigned char transition)
{ {
unsigned char operstate = dev->operstate; unsigned char operstate = dev->operstate;
...@@ -527,12 +527,8 @@ static int set_operstate(struct net_device *dev, unsigned char transition, bool ...@@ -527,12 +527,8 @@ static int set_operstate(struct net_device *dev, unsigned char transition, bool
write_lock_bh(&dev_base_lock); write_lock_bh(&dev_base_lock);
dev->operstate = operstate; dev->operstate = operstate;
write_unlock_bh(&dev_base_lock); write_unlock_bh(&dev_base_lock);
netdev_state_change(dev);
if (send_notification) }
netdev_state_change(dev);
return 1;
} else
return 0;
} }
static void copy_rtnl_link_stats(struct rtnl_link_stats *a, static void copy_rtnl_link_stats(struct rtnl_link_stats *a,
...@@ -826,7 +822,6 @@ static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm, ...@@ -826,7 +822,6 @@ static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm,
if (tb[IFLA_BROADCAST]) { if (tb[IFLA_BROADCAST]) {
nla_memcpy(dev->broadcast, tb[IFLA_BROADCAST], dev->addr_len); nla_memcpy(dev->broadcast, tb[IFLA_BROADCAST], dev->addr_len);
send_addr_notify = 1; send_addr_notify = 1;
modified = 1;
} }
if (ifm->ifi_flags || ifm->ifi_change) { if (ifm->ifi_flags || ifm->ifi_change) {
...@@ -839,23 +834,16 @@ static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm, ...@@ -839,23 +834,16 @@ static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm,
dev_change_flags(dev, flags); dev_change_flags(dev, flags);
} }
if (tb[IFLA_TXQLEN]) { if (tb[IFLA_TXQLEN])
if (dev->tx_queue_len != nla_get_u32(tb[IFLA_TXQLEN])) { dev->tx_queue_len = nla_get_u32(tb[IFLA_TXQLEN]);
dev->tx_queue_len = nla_get_u32(tb[IFLA_TXQLEN]);
modified = 1;
}
}
if (tb[IFLA_OPERSTATE]) if (tb[IFLA_OPERSTATE])
modified |= set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE]), false); set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE]));
if (tb[IFLA_LINKMODE]) { if (tb[IFLA_LINKMODE]) {
if (dev->link_mode != nla_get_u8(tb[IFLA_LINKMODE])) { write_lock_bh(&dev_base_lock);
write_lock_bh(&dev_base_lock); dev->link_mode = nla_get_u8(tb[IFLA_LINKMODE]);
dev->link_mode = nla_get_u8(tb[IFLA_LINKMODE]); write_unlock_bh(&dev_base_lock);
write_lock_bh(&dev_base_lock);
modified = 1;
}
} }
err = 0; err = 0;
...@@ -869,10 +857,6 @@ static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm, ...@@ -869,10 +857,6 @@ static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm,
if (send_addr_notify) if (send_addr_notify)
call_netdevice_notifiers(NETDEV_CHANGEADDR, dev); call_netdevice_notifiers(NETDEV_CHANGEADDR, dev);
if (modified)
netdev_state_change(dev);
return err; return err;
} }
...@@ -990,7 +974,7 @@ struct net_device *rtnl_create_link(struct net *net, char *ifname, ...@@ -990,7 +974,7 @@ struct net_device *rtnl_create_link(struct net *net, char *ifname,
if (tb[IFLA_TXQLEN]) if (tb[IFLA_TXQLEN])
dev->tx_queue_len = nla_get_u32(tb[IFLA_TXQLEN]); dev->tx_queue_len = nla_get_u32(tb[IFLA_TXQLEN]);
if (tb[IFLA_OPERSTATE]) if (tb[IFLA_OPERSTATE])
set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE]), true); set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE]));
if (tb[IFLA_LINKMODE]) if (tb[IFLA_LINKMODE])
dev->link_mode = nla_get_u8(tb[IFLA_LINKMODE]); dev->link_mode = nla_get_u8(tb[IFLA_LINKMODE]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment