From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753473AbdJaNo3 (ORCPT ); Tue, 31 Oct 2017 09:44:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38114 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753324AbdJaNnw (ORCPT ); Tue, 31 Oct 2017 09:43:52 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 660A2806B9 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=vkuznets@redhat.com From: Vitaly Kuznetsov To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger Subject: [PATCH net-next 3/4] hv_netvsc: reset net_device_ctx->nvdev with rcu_assign_pointer() Date: Tue, 31 Oct 2017 14:42:03 +0100 Message-Id: <20171031134204.15287-4-vkuznets@redhat.com> In-Reply-To: <20171031134204.15287-1-vkuznets@redhat.com> References: <20171031134204.15287-1-vkuznets@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 31 Oct 2017 13:43:52 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org RCU_INIT_POINTER() is not suitable here as it doesn't give us ordering guarantees (see the comment in rcupdate.h). This is also not a hotpath. Signed-off-by: Vitaly Kuznetsov --- drivers/net/hyperv/netvsc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index bfc79698b8f4..12efb3e34775 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c @@ -560,7 +560,7 @@ void netvsc_device_remove(struct hv_device *device) netvsc_revoke_buf(device, net_device); - RCU_INIT_POINTER(net_device_ctx->nvdev, NULL); + rcu_assign_pointer(net_device_ctx->nvdev, NULL); /* * At this point, no one should be accessing net_device -- 2.13.6