]> git.baikalelectronics.ru Git - kernel.git/commit
bonding: Fix deadlock in bonding driver when using netpoll
authordingtianhong <dingtianhong@huawei.com>
Wed, 12 Feb 2014 04:06:40 +0000 (12:06 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 13 Feb 2014 22:08:29 +0000 (17:08 -0500)
commit573b522ed5c695cad9a0f4cadceb64ac5adcbbd2
treeebafceda4aeb7c2e10ded3667b9bf47c2c0c79e3
parent97fa25191b7a429f84d408bfdc1ea08b53fb9182
bonding: Fix deadlock in bonding driver when using netpoll

The bonding driver take write locks and spin locks that are shared
by the tx path in enslave processing and notification processing,
If the netconsole is in use, the bonding can call printk which puts
us in the netpoll tx path, if the netconsole is attached to the bonding
driver, result in deadlock.

So add protection for these place, by checking the netpoll_block_tx
state, we can defer the sending of the netconsole frames until a later
time using the retransmit feature of netpoll_send_skb that is triggered
on the return code NETDEV_TX_BUSY.

Cc: Jay Vosburgh <fubar@us.ibm.com>
Cc: Veaceslav Falico <vfalico@redhat.com>
Cc: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bonding/bond_main.c