mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
netvsc: fix deadlock betwen link status and removal
[ Upstream commit9b4e946ce1] There is a deadlock possible when canceling the link status delayed work queue. The removal process is run with RTNL held, and the link status callback is acquring RTNL. Resolve the issue by using trylock and rescheduling. If cancel is in process, that block it from happening. Fixes:122a5f6410("staging: hv: use delayed_work for netvsc_send_garp()") Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
64dfc67548
commit
de2ecec26d
@@ -1084,7 +1084,12 @@ static void netvsc_link_change(struct work_struct *w)
|
||||
bool notify = false, reschedule = false;
|
||||
unsigned long flags, next_reconfig, delay;
|
||||
|
||||
rtnl_lock();
|
||||
/* if changes are happening, comeback later */
|
||||
if (!rtnl_trylock()) {
|
||||
schedule_delayed_work(&ndev_ctx->dwork, LINKCHANGE_INT);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ndev_ctx->start_remove)
|
||||
goto out_unlock;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user