From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE405C10F14 for ; Thu, 3 Oct 2019 21:42:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8E25E2133F for ; Thu, 3 Oct 2019 21:42:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570138941; bh=wc6zJQicDvo3ks4P6CXzbbolwKSwVh6gY+HN4p79Nk4=; h=From:To:Cc:Subject:Date:List-ID:From; b=Z/rpJZSBlSuu+qI8AF+VapIyGyom09noxnrU4CDX7XDrfLn/3a8//ROrsO0DWeFPF dIQIXbrRyXzu36CDfhkK4t5a/NOmE6K7MQiJJUJCcsWjPNr7gHV/wiuYQq8wIJwfd4 GmlDnywLqUn+HLafiGMG6xhUKSDRKuXL20bQD04M= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732887AbfJCVmU (ORCPT ); Thu, 3 Oct 2019 17:42:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:36936 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731058AbfJCVmU (ORCPT ); Thu, 3 Oct 2019 17:42:20 -0400 Received: from kenny.it.cumulusnetworks.com. (fw.cumulusnetworks.com [216.129.126.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B65BD20679; Thu, 3 Oct 2019 21:42:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570138939; bh=wc6zJQicDvo3ks4P6CXzbbolwKSwVh6gY+HN4p79Nk4=; h=From:To:Cc:Subject:Date:From; b=ismxWFhMtU9rtAo7svYY0/47QjlbzW/eUr+C+Ve/IPVpKsxdPw+8qXw5ba5LjPEey 8qNMrb1ehaK0RjXp7jkMuMrGWKEP+c53+bdzK5Zdn/+yTmEfcmn+0cUATjsdB9hUb6 xoVxretLGkODfk3Wyx4bbbEQXU4fWlQRjxyjxYhc= From: David Ahern To: davem@davemloft.net, jakub.kicinski@netronome.com Cc: netdev@vger.kernel.org, rajendra.dendukuri@broadcom.com, eric.dumazet@gmail.com, David Ahern , Eric Dumazet Subject: [PATCH net] Revert "ipv6: Handle race in addrconf_dad_work" Date: Thu, 3 Oct 2019 14:46:15 -0700 Message-Id: <20191003214615.10119-1-dsahern@kernel.org> X-Mailer: git-send-email 2.11.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: David Ahern This reverts commit a3ce2a21bb8969ae27917281244fa91bf5f286d7. Eric reported tests failings with commit. After digging into it, the bottom line is that the DAD sequence is not to be messed with. There are too many cases that are expected to proceed regardless of whether a device is up. Revert the patch and I will send a different solution for the problem Rajendra reported. Signed-off-by: David Ahern Cc: Eric Dumazet --- net/ipv6/addrconf.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index dd3be06d5a06..6a576ff92c39 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -4032,12 +4032,6 @@ static void addrconf_dad_work(struct work_struct *w) rtnl_lock(); - /* check if device was taken down before this delayed work - * function could be canceled - */ - if (idev->dead || !(idev->if_flags & IF_READY)) - goto out; - spin_lock_bh(&ifp->lock); if (ifp->state == INET6_IFADDR_STATE_PREDAD) { action = DAD_BEGIN; @@ -4083,6 +4077,11 @@ static void addrconf_dad_work(struct work_struct *w) goto out; write_lock_bh(&idev->lock); + if (idev->dead || !(idev->if_flags & IF_READY)) { + write_unlock_bh(&idev->lock); + goto out; + } + spin_lock(&ifp->lock); if (ifp->state == INET6_IFADDR_STATE_DEAD) { spin_unlock(&ifp->lock); -- 2.11.0