FAILED: patch "[PATCH] netvsc: fix deadlock betwen link status and removal" failed to apply to 4.4-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 4.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
Quoted 1 line
From
9b4e946ce14e20d7addbfb7d9139e604f9fda107Mon Sep 17 00:00:00 2001
From: stephen hemminger <[email protected]>
Date: Thu, 24 Aug 2017 16:49:16 -0700
Subject: [PATCH] netvsc: fix deadlock betwen link status and removal
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.
drivers/net/hyperv/netvsc_drv.c +6 -1
@@ -1269,7 +1269,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 ; + } + net_device =rtnl_dereference (ndev_ctx->nvdev);if (!net_device) goto out_unlock;