]> git.karo-electronics.de Git - karo-tx-linux.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)
commitf80889a5b79cae0b84465a90c21b1273a03b7973
treeebafceda4aeb7c2e10ded3667b9bf47c2c0c79e3
parent455016e5dc623cb784dbaa4f197054ab87d84c76
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