Skip to content

Commit

Permalink
bonding: drop read_lock in bond_compute_features
Browse files Browse the repository at this point in the history
bond_compute_features is always called with RTNL held, so we can safely
drop the read bond->lock.

Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
nikolay@redhat.com authored and David S. Miller committed Sep 4, 2013
1 parent 9b7b165 commit c482686
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1116,15 +1116,13 @@ static netdev_features_t bond_fix_features(struct net_device *dev,

static void bond_compute_features(struct bonding *bond)
{
struct slave *slave;
struct net_device *bond_dev = bond->dev;
unsigned int flags, dst_release_flag = IFF_XMIT_DST_RELEASE;
netdev_features_t vlan_features = BOND_VLAN_FEATURES;
unsigned short max_hard_header_len = ETH_HLEN;
unsigned int gso_max_size = GSO_MAX_SIZE;
struct net_device *bond_dev = bond->dev;
u16 gso_max_segs = GSO_MAX_SEGS;
unsigned int flags, dst_release_flag = IFF_XMIT_DST_RELEASE;

read_lock(&bond->lock);
struct slave *slave;

if (list_empty(&bond->slave_list))
goto done;
Expand All @@ -1150,8 +1148,6 @@ static void bond_compute_features(struct bonding *bond)
flags = bond_dev->priv_flags & ~IFF_XMIT_DST_RELEASE;
bond_dev->priv_flags = flags | dst_release_flag;

read_unlock(&bond->lock);

netdev_change_features(bond_dev);
}

Expand Down

0 comments on commit c482686

Please sign in to comment.