Received: by 10.213.65.68 with SMTP id h4csp275474imn; Fri, 23 Mar 2018 04:31:01 -0700 (PDT) X-Google-Smtp-Source: AG47ELt8y1hAPYgbujah4+kSNRY10fsi7CB1mYHq9Nv2uzA+fWVAVztmeZH5MmngJ6ng3zvl78ux X-Received: by 2002:a17:902:5a5:: with SMTP id f34-v6mr29231584plf.288.1521804661378; Fri, 23 Mar 2018 04:31:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521804661; cv=none; d=google.com; s=arc-20160816; b=XSvo0aVkTvkTa6PnwB5RO22FrhzxVH9o3ynIH9xsdGcBj2hi+7Flqme/yBI2hmujLi g6eVzzy1ARct0j8VCnno/YUJCxoX9P+B2CpJbf7pz/tEAOqoQzqAdyZVYZ5fWvnsx+8n 2QN7Y126rNQdp1nZcOJ5uSDTkCOHSzUMvzzaSGrUvplVOXWONAPTrwrzIuyYXZ92JVvH RbGilh/O3KjO/ToTeorbDdmms/RSnCkS3x7guRF2OctvYAJJqStSpqFKow6gJ7tMhz4O q+J1EsMcgAMgE8WR+JPxIIj6n7FAPXzL7WjsB8dFVFmk3Y4kVUVJbhsXQ9Tx296Rsgt4 iUyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=pNGBBbhLRIizPbBzdAZ+CHWG87qH7pSi/LwLypQEPXU=; b=aoxqdTcTP7E5/uO4y8uxLA7UMPDUQYFeJYV354a1tt0oL16VMWjsAEL1V0XKdYrefR OWM2oIgz5jXmoIM/QMbJHIM5Daeek52fPVXPl6ueOuGhfdIqFSp9CW3K0wBCeVbn/K47 pk47bmBp4vfxYwY7AM6Gn05r010gsC0Fq9XVWy3YQQGn5bHD1SPwUa/hVhDs+wSf60xE fg7svFSohwtDthXH2rEwUXq8U4ONUV+5S0Bhn/YCM893K5vFM3xS4rUtKGxOelOr8jze Ju3OqpVvK97VhDdFBSo4bpzr06E16yrdryc2441cKUM7GcDjhPaCFcbrv9D//jJZ8QA6 at5g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t2-v6si8910687plj.651.2018.03.23.04.30.46; Fri, 23 Mar 2018 04:31:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755240AbeCWKGZ (ORCPT + 99 others); Fri, 23 Mar 2018 06:06:25 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:40754 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755207AbeCWKGX (ORCPT ); Fri, 23 Mar 2018 06:06:23 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id B4A3AC32; Fri, 23 Mar 2018 10:06:22 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "K. Y. Srinivasan" , "David S. Miller" , Sasha Levin Subject: [PATCH 4.9 054/177] netvsc: Deal with rescinded channels correctly Date: Fri, 23 Mar 2018 10:53:02 +0100 Message-Id: <20180323094207.738694716@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180323094205.090519271@linuxfoundation.org> References: <20180323094205.090519271@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: "K. Y. Srinivasan" [ Upstream commit 73e64fa4f417b22d8d5521999a631ced8e2d442e ] We will not be able to send packets over a channel that has been rescinded. Make necessary adjustments so we can properly cleanup even when the channel is rescinded. This issue can be trigerred in the NIC hot-remove path. Signed-off-by: K. Y. Srinivasan Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/hyperv/netvsc.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c @@ -151,6 +151,13 @@ static void netvsc_destroy_buf(struct hv sizeof(struct nvsp_message), (unsigned long)revoke_packet, VM_PKT_DATA_INBAND, 0); + /* If the failure is because the channel is rescinded; + * ignore the failure since we cannot send on a rescinded + * channel. This would allow us to properly cleanup + * even when the channel is rescinded. + */ + if (device->channel->rescind) + ret = 0; /* * If we failed here, we might as well return and * have a leak rather than continue and a bugchk @@ -211,6 +218,15 @@ static void netvsc_destroy_buf(struct hv sizeof(struct nvsp_message), (unsigned long)revoke_packet, VM_PKT_DATA_INBAND, 0); + + /* If the failure is because the channel is rescinded; + * ignore the failure since we cannot send on a rescinded + * channel. This would allow us to properly cleanup + * even when the channel is rescinded. + */ + if (device->channel->rescind) + ret = 0; + /* If we failed here, we might as well return and * have a leak rather than continue and a bugchk */