RDMA/hns: fix possible dead lock when setting RoCE Bonding
driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I63IM5 --------------------------------------------------------------------------- When setting RoCE Bonding, a new hr_dev will be registered as "hns_bond_xx". In the process, the bonding thread will try to acquire rtnl_lock() while holding roce_bond_mutex. However, it's possible that another thread running bond_netdev_notify_work() grabs rtnl_lock() before the bonding thread, and call the bonding notifier function, in which the thread will try to acquire roce_bond_mutex, finally leading to a dead lock. As the event informer notifier_call_chain() will not call the next notifier function until the current one returns, there is no need to use a mutex in the bonding notifier function. Thus, remove roce_bond_mutex in hns_roce_bond_event() and the dead lock can be avoided. Fixes: e62a2027 ("RDMA/hns: support RoCE bonding") Signed-off-by:Junxian Huang <huangjunxian6@hisilicon.com> Reviewed-by:
Yangyang Li <liyangyang20@huawei.com> Reviewed-by:
Yue Haibing <yuehaibing@huawei.com> Signed-off-by:
Zheng Zengkai <zhengzengkai@huawei.com>
Loading
Please sign in to comment