Skip to content

Commit

Permalink
bonding: add missed __rcu annotation for curr_active_slave
Browse files Browse the repository at this point in the history
[ Upstream commit 3d0b738 ]

There is one direct accesses to bond->curr_active_slave in
bond_miimon_commit(). Protected it by rcu_access_pointer()
since the later of this function also use this one.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: e95cc44 ("bonding: do failover when high prio link up")
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
liuhangbin authored and gregkh committed Dec 31, 2022
1 parent ba44c1f commit 2d31c6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2698,7 +2698,7 @@ static void bond_miimon_commit(struct bonding *bond)

bond_miimon_link_change(bond, slave, BOND_LINK_UP);

if (!bond->curr_active_slave || slave == primary)
if (!rcu_access_pointer(bond->curr_active_slave) || slave == primary)
goto do_failover;

continue;
Expand Down

0 comments on commit 2d31c6e

Please sign in to comment.