team: move netlink event notifiers after team_port_leave()
authorJiri Pirko <jiri@resnulli.us>
Fri, 1 Feb 2013 08:17:25 +0000 (08:17 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 4 Feb 2013 19:55:45 +0000 (14:55 -0500)
In team_port_del(), there is need to be do all the cleanup related
things first and netlink event notifiers should be called after that.
This fixes two problems:
team carrier is now correctly set (port is removed from list first)
mode can set option as changed in .port_leave op

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/team/team.c

index 738f7445ea87f85fa383f776e961558f8e23669d..694ccf6d71a3bca9d502ac670c543f2e70149d64 100644 (file)
@@ -1131,10 +1131,6 @@ static int team_port_del(struct team *team, struct net_device *port_dev)
                return -ENOENT;
        }
 
-       __team_option_inst_mark_removed_port(team, port);
-       __team_options_change_check(team);
-       __team_option_inst_del_port(team, port);
-       __team_port_change_port_removed(port);
        team_port_disable(team, port);
        list_del_rcu(&port->list);
        netdev_rx_handler_unregister(port_dev);
@@ -1143,6 +1139,12 @@ static int team_port_del(struct team *team, struct net_device *port_dev)
        vlan_vids_del_by_dev(port_dev, dev);
        dev_close(port_dev);
        team_port_leave(team, port);
+
+       __team_option_inst_mark_removed_port(team, port);
+       __team_options_change_check(team);
+       __team_option_inst_del_port(team, port);
+       __team_port_change_port_removed(port);
+
        team_port_set_orig_dev_addr(port);
        dev_set_mtu(port_dev, port->orig.mtu);
        synchronize_rcu();