Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp4038955pxp; Tue, 15 Mar 2022 11:08:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmWp2i9DK07nPi+vHbf8l1NxQm6bbVYgH2al7RtUmm8eNsD9dmJYGVbTL3ravD2arUdSOk X-Received: by 2002:a17:903:230f:b0:151:e465:1877 with SMTP id d15-20020a170903230f00b00151e4651877mr29777685plh.19.1647367698041; Tue, 15 Mar 2022 11:08:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647367698; cv=none; d=google.com; s=arc-20160816; b=MRwP0aLyF4OZ/Ef3jFJDnjQ2Wwq4UdQwULZPWu6wG+r9usb7mf7pOJIcP7anFKg4Y3 Iy1hF900E5c1LIwe1hkQPnFxFbX/Ev+8xkmotpPYi5QdjmUB7QPAzzypomHAdEWcBN/J JMdzFqzlUt7DFtj1bIceZsNQaWRmkyNa44kVIxIVah6XwZfpPB5uUu6PAyxTp5NHw3cX 0kIAT8/qBsKwKRoYHKTcG7QyF2Gac1k8Cgt6/+/Lkwm5pax6Q69KhuV8gRkKGE39JAeu ynNy0WMdLy/36lWoN8ef9giHKb3wm+eXordwMZWd5nsebYV1iraDtD8001uFlWLoR7xF KmqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=H9tzYG9kFSOHDI/P9mublsUtKelvAKaxTuOd86BhVnQ=; b=FoP+JQZi3zCMOxIznJvuX1QS5iRdUggtQIHadARD4x+9XrQUXtHEwQuUJZxx59Dmsm ghYoUxLEH6I2gWbqAlhSzEpCGh9tVRZJr/VinJiw8vOGEw7cAvbcre56afrqusoD2iS9 TxH3h/DsJC+iigam0YVxj+Ld05fBqJZOhfLQGa1B0awz1A5IXOGn218oP8glya78ahFq oYSD5ZfPEsLHILCFk3BcXMC1IUKk9iveA2MNHPPwvvXuS+ltmpJjKxEHHfYR3Lz3gIek FCYWMIbXTBxJrs1Y6fhFdS0EcuiLSZChAA2tcHXqYItodOo2f1Am0rA8k/UpsrmRNxqN avHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="J/HgVO7n"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r185-20020a632bc2000000b003803fbd0f7csi18509212pgr.619.2022.03.15.11.08.00; Tue, 15 Mar 2022 11:08:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="J/HgVO7n"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239283AbiCNLlC (ORCPT + 99 others); Mon, 14 Mar 2022 07:41:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239255AbiCNLkl (ORCPT ); Mon, 14 Mar 2022 07:40:41 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B4B048389; Mon, 14 Mar 2022 04:38:19 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 07569B80DBA; Mon, 14 Mar 2022 11:38:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0FF7BC340E9; Mon, 14 Mar 2022 11:38:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647257896; bh=9ivKaocIBrsO/E9bsJPLlnpsZWHkR52ubNS+VUoDfiM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J/HgVO7nzPLHU/wt3HX10uCOAend3LBRSmgSfUpa6TRQtH9rS49hwRQEsL2y+agbo RsxHCEm6RmOUb/bnEdqs37aLSFWxS8DV2+DVGfBY+2ht1ROqo/lzIM5fHsSAidSI0n tVHRxcDWvyVRasdRwut3M2t92BDqePX1ADdgJuPQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Paul Durrant , Michael Brown , Jakub Kicinski , Sasha Levin Subject: [PATCH 4.19 15/30] Revert "xen-netback: Check for hotplug-status existence before watching" Date: Mon, 14 Mar 2022 12:34:33 +0100 Message-Id: <20220314112732.220289656@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220314112731.785042288@linuxfoundation.org> References: <20220314112731.785042288@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marek Marczykowski-Górecki [ Upstream commit e8240addd0a3919e0fd7436416afe9aa6429c484 ] This reverts commit 2afeec08ab5c86ae21952151f726bfe184f6b23d. The reasoning in the commit was wrong - the code expected to setup the watch even if 'hotplug-status' didn't exist. In fact, it relied on the watch being fired the first time - to check if maybe 'hotplug-status' is already set to 'connected'. Not registering a watch for non-existing path (which is the case if hotplug script hasn't been executed yet), made the backend not waiting for the hotplug script to execute. This in turns, made the netfront think the interface is fully operational, while in fact it was not (the vif interface on xen-netback side might not be configured yet). This was a workaround for 'hotplug-status' erroneously being removed. But since that is reverted now, the workaround is not necessary either. More discussion at https://lore.kernel.org/xen-devel/afedd7cb-a291-e773-8b0d-4db9b291fa98@ipxe.org/T/#u Signed-off-by: Marek Marczykowski-Górecki Reviewed-by: Paul Durrant Reviewed-by: Michael Brown Link: https://lore.kernel.org/r/20220222001817.2264967-2-marmarek@invisiblethingslab.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/xen-netback/xenbus.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c index 6b678ab0a31f..6d7fb0a95645 100644 --- a/drivers/net/xen-netback/xenbus.c +++ b/drivers/net/xen-netback/xenbus.c @@ -1044,15 +1044,11 @@ static void connect(struct backend_info *be) xenvif_carrier_on(be->vif); unregister_hotplug_status_watch(be); - if (xenbus_exists(XBT_NIL, dev->nodename, "hotplug-status")) { - err = xenbus_watch_pathfmt(dev, &be->hotplug_status_watch, - NULL, hotplug_status_changed, - "%s/%s", dev->nodename, - "hotplug-status"); - if (err) - goto err; + err = xenbus_watch_pathfmt(dev, &be->hotplug_status_watch, NULL, + hotplug_status_changed, + "%s/%s", dev->nodename, "hotplug-status"); + if (!err) be->have_hotplug_status_watch = 1; - } netif_tx_wake_all_queues(be->vif->dev); -- 2.34.1