[net-next,1/2] team: move netlink event notifiers after team_port_leave()

Message ID 1359728882-15333-1-git-send-email-jiri@resnulli.us
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Jiri Pirko Feb. 1, 2013, 2:28 p.m.
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>
 drivers/net/team/team.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)


diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index 70d5d6b..1567cc8 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -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);
@@ -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);
 	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);
 	dev_set_mtu(port_dev, port->orig.mtu);