Commit c4826861 authored by nikolay@redhat.com's avatar nikolay@redhat.com Committed by David S. Miller

bonding: drop read_lock in bond_compute_features

bond_compute_features is always called with RTNL held, so we can safely
drop the read bond->lock.
Signed-off-by: default avatarNikolay Aleksandrov <nikolay@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9b7b165a
...@@ -1116,15 +1116,13 @@ static netdev_features_t bond_fix_features(struct net_device *dev, ...@@ -1116,15 +1116,13 @@ static netdev_features_t bond_fix_features(struct net_device *dev,
static void bond_compute_features(struct bonding *bond) static void bond_compute_features(struct bonding *bond)
{ {
struct slave *slave; unsigned int flags, dst_release_flag = IFF_XMIT_DST_RELEASE;
struct net_device *bond_dev = bond->dev;
netdev_features_t vlan_features = BOND_VLAN_FEATURES; netdev_features_t vlan_features = BOND_VLAN_FEATURES;
unsigned short max_hard_header_len = ETH_HLEN; unsigned short max_hard_header_len = ETH_HLEN;
unsigned int gso_max_size = GSO_MAX_SIZE; unsigned int gso_max_size = GSO_MAX_SIZE;
struct net_device *bond_dev = bond->dev;
u16 gso_max_segs = GSO_MAX_SEGS; u16 gso_max_segs = GSO_MAX_SEGS;
unsigned int flags, dst_release_flag = IFF_XMIT_DST_RELEASE; struct slave *slave;
read_lock(&bond->lock);
if (list_empty(&bond->slave_list)) if (list_empty(&bond->slave_list))
goto done; goto done;
...@@ -1150,8 +1148,6 @@ static void bond_compute_features(struct bonding *bond) ...@@ -1150,8 +1148,6 @@ static void bond_compute_features(struct bonding *bond)
flags = bond_dev->priv_flags & ~IFF_XMIT_DST_RELEASE; flags = bond_dev->priv_flags & ~IFF_XMIT_DST_RELEASE;
bond_dev->priv_flags = flags | dst_release_flag; bond_dev->priv_flags = flags | dst_release_flag;
read_unlock(&bond->lock);
netdev_change_features(bond_dev); netdev_change_features(bond_dev);
} }
......
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