2.4.36-stable kernel tree
Revisão | b282a91df099f6ddc97936a882feac10859b1bcc (tree) |
---|---|
Hora | 2008-11-09 23:32:11 |
Autor | Andy Gospodarek <andy@grey...> |
Commiter | Willy Tarreau |
bonding: fix panic when taking bond interface down before removing module
[backport of 2.6 commit ce39a800ea87c655de49af021c8b20ee323cb40d]
A panic was discovered with bonding when using mode 5 or 6 and trying to
remove the slaves from the bond after the interface was taken down.
When calling 'ifconfig bond0 down' the following happens:
Unfortunately if there are still slaves in the bond, when removing the
module the following happens:
As you might guess we panic when trying to access a few entries into the
table that no longer exists.
I experimented with several options (like moving the calls to
tlb_deinitialize somewhere else), but it really makes the most sense to
be part of the bond_close routine. It also didn't seem logical move
tlb_clear_slave around too much, so the simplest option seems to add a
check in tlb_clear_slave to make sure we haven't already wiped the
tx_hashtbl away before searching for all the non-existent hash-table
entries that used to point to the slave as the output interface.
Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
@@ -183,11 +183,13 @@ static void tlb_clear_slave(struct bonding *bond, struct slave *slave, int save_ | ||
183 | 183 | /* clear slave from tx_hashtbl */ |
184 | 184 | tx_hash_table = BOND_ALB_INFO(bond).tx_hashtbl; |
185 | 185 | |
186 | - index = SLAVE_TLB_INFO(slave).head; | |
187 | - while (index != TLB_NULL_INDEX) { | |
188 | - u32 next_index = tx_hash_table[index].next; | |
189 | - tlb_init_table_entry(&tx_hash_table[index], save_load); | |
190 | - index = next_index; | |
186 | + if (tx_hash_table) { | |
187 | + index = SLAVE_TLB_INFO(slave).head; | |
188 | + while (index != TLB_NULL_INDEX) { | |
189 | + u32 next_index = tx_hash_table[index].next; | |
190 | + tlb_init_table_entry(&tx_hash_table[index], save_load); | |
191 | + index = next_index; | |
192 | + } | |
191 | 193 | } |
192 | 194 | |
193 | 195 | tlb_init_slave(slave); /* Stratus88746: do this before unlocking */ |