]> 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)
commit52104942ffa76fa2c8a59cc3556a279d2472b6b7
treeebafceda4aeb7c2e10ded3667b9bf47c2c0c79e3
parent05159d23fda85b8a616153de99f3259d7f7883da
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