mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	bonding: fix link recovery in mode 2 when updelay is nonzero
Before this change when a bond in mode 2 lost link, all of its slaves
lost link, the bonding device would never recover even after the
expiration of updelay. This change removes the updelay when the bond
currently has no usable links. Conforming to bonding.txt section 13.1
paragraph 4.
Fixes: 41f8910040 ("bonding: ignore updelay param when there is no active slave")
Signed-off-by: Jonathan Toppins <jtoppins@redhat.com>
Acked-by: Jay Vosburgh <jay.vosburgh@canonical.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
			
			
This commit is contained in:
		
							parent
							
								
									d43eff0b85
								
							
						
					
					
						commit
						f8a65ab2f3
					
				
					 1 changed files with 10 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -2529,7 +2529,16 @@ static int bond_miimon_inspect(struct bonding *bond)
 | 
			
		|||
	struct slave *slave;
 | 
			
		||||
	bool ignore_updelay;
 | 
			
		||||
 | 
			
		||||
	ignore_updelay = !rcu_dereference(bond->curr_active_slave);
 | 
			
		||||
	if (BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP) {
 | 
			
		||||
		ignore_updelay = !rcu_dereference(bond->curr_active_slave);
 | 
			
		||||
	} else {
 | 
			
		||||
		struct bond_up_slave *usable_slaves;
 | 
			
		||||
 | 
			
		||||
		usable_slaves = rcu_dereference(bond->usable_slaves);
 | 
			
		||||
 | 
			
		||||
		if (usable_slaves && usable_slaves->count == 0)
 | 
			
		||||
			ignore_updelay = true;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	bond_for_each_slave_rcu(bond, slave, iter) {
 | 
			
		||||
		bond_propose_link_state(slave, BOND_LINK_NOCHANGE);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue