From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:58818 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751620AbdIOGWd (ORCPT ); Fri, 15 Sep 2017 02:22:33 -0400 Subject: Patch "netvsc: fix deadlock betwen link status and removal" has been added to the 4.9-stable tree To: stephen@networkplumber.org, davem@davemloft.net, gregkh@linuxfoundation.org, sthemmin@microsoft.com Cc: , From: Date: Thu, 14 Sep 2017 23:22:15 -0700 Message-ID: <1505456535047@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled netvsc: fix deadlock betwen link status and removal to the 4.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: netvsc-fix-deadlock-betwen-link-status-and-removal.patch and it can be found in the queue-4.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From foo@baz Thu Sep 14 23:20:08 PDT 2017 From: stephen hemminger Date: Thu, 24 Aug 2017 16:49:16 -0700 Subject: netvsc: fix deadlock betwen link status and removal From: stephen hemminger [ Upstream commit 9b4e946ce14e20d7addbfb7d9139e604f9fda107 ] 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: 122a5f6410f4 ("staging: hv: use delayed_work for netvsc_send_garp()") Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/hyperv/netvsc_drv.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -1084,7 +1084,12 @@ static void netvsc_link_change(struct wo 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; Patches currently in stable-queue which might be from stephen@networkplumber.org are queue-4.9/netvsc-fix-deadlock-betwen-link-status-and-removal.patch