From nobody Thu Dec 26 13:55:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=edera.dev ARC-Seal: i=1; a=rsa-sha256; t=1732051085; cv=none; d=zohomail.com; s=zohoarc; b=eNP2ejs61Y8VHHkcQ2l4bSS8a27pFUtf5vAsQZPGYxhfq4FSvSq8d+8+hHkVWEXQ67XCUDaZCSycXEhvSSsALl8LLrXIK16/ujtlAESO1SGFX6EXAxC2JiNpEhRjwsgQhnU2LaDOwcMZjO3YJk+1nPDueh7R+r3ulbNs09ZucoE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732051085; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Eg7OcnGXpKtgXWaHwtGS+ToZC8TTTiMcCPq5ZYxyLCo=; b=lGUyB/pP5SHodO1OUsDmjC70Sz/ZQ2VMX5qOGS9lBx06Yf+OMjZypnbZ+8Dudwb4hgpW/orIMWHWjPPDLLsMZKIEFrl+Ku6kVMnPI576GrySDgK4z72X9bSe4dxCL0amzs0FpmYEtCa7Aol7iphZ5LL1h7Cuk0wCWuMeQZZtJos= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1732051085490949.5215634641885; Tue, 19 Nov 2024 13:18:05 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.840779.1256305 (Exim 4.92) (envelope-from ) id 1tDVbR-0002eg-UY; Tue, 19 Nov 2024 21:17:41 +0000 Received: by outflank-mailman (output) from mailman id 840779.1256305; Tue, 19 Nov 2024 21:17:41 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tDVbR-0002eZ-Qt; Tue, 19 Nov 2024 21:17:41 +0000 Received: by outflank-mailman (input) for mailman id 840779; Tue, 19 Nov 2024 21:16:54 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tDVag-0002dS-Az for xen-devel@lists.xenproject.org; Tue, 19 Nov 2024 21:16:54 +0000 Received: from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com [2607:f8b0:4864:20::f33]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 96a7baaa-a6bb-11ef-99a3-01e77a169b0f; Tue, 19 Nov 2024 22:16:49 +0100 (CET) Received: by mail-qv1-xf33.google.com with SMTP id 6a1803df08f44-6d382677c92so26448716d6.3 for ; Tue, 19 Nov 2024 13:16:49 -0800 (PST) Received: from ip-172-31-19-182.us-east-2.compute.internal (ec2-18-219-201-45.us-east-2.compute.amazonaws.com. [18.219.201.45]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6d4380db2edsm865966d6.36.2024.11.19.13.16.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Nov 2024 13:16:47 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 96a7baaa-a6bb-11ef-99a3-01e77a169b0f X-Custom-Connection: eyJyZW1vdGVpcCI6IjI2MDc6ZjhiMDo0ODY0OjIwOjpmMzMiLCJoZWxvIjoibWFpbC1xdjEteGYzMy5nb29nbGUuY29tIn0= X-Custom-Transaction: eyJpZCI6Ijk2YTdiYWFhLWE2YmItMTFlZi05OWEzLTAxZTc3YTE2OWIwZiIsInRzIjoxNzMyMDUxMDA5LjU1NDE0Niwic2VuZGVyIjoiYWxleGFuZGVyQGVkZXJhLmRldiIsInJlY2lwaWVudCI6Inhlbi1kZXZlbEBsaXN0cy54ZW5wcm9qZWN0Lm9yZyJ9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=edera.dev; s=google; t=1732051008; x=1732655808; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Eg7OcnGXpKtgXWaHwtGS+ToZC8TTTiMcCPq5ZYxyLCo=; b=MCdyx9uTe5jSoJ1q9u0wq1q/XWvpfWXzLTChrklTLJuvniTV55EFMJoxSGggzTYhBd oeY8TBAmu19v0zmjHeQY7Yp1qY67iiLLWSuFL+mProY7MmkySEeIzsxbFOazyuVodvgV mb9OT3H7FXV07+aZQcsWfOZ0CVtndPYcg4YHtjb0clB097Wd5bNNEdkf1crqKVDuTwmW HZiJHYFbbw7mnKuvQfWt6ODO11WHvIJC7ecw1XhOKsTrpsJGlKDMAZ5srfvVpM0gWN1M QShQOfKVSy071PxVpToRx+vSzfPboBS96+fvqT0cBif/2ltBGOcaOpcZgafzVbpct9Ko zi7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732051008; x=1732655808; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Eg7OcnGXpKtgXWaHwtGS+ToZC8TTTiMcCPq5ZYxyLCo=; b=UNfeRwxzTX5hvkXmLPmXYiOh5AHW2SXnBEHXcguV2X2jfHDw0y0QBs8DfkFNQJ94zI zV8rtMcJ1v82UuV8EvBbumMycYRIb0IunV3uGGn2LzLRHoAgCcBpcYlAJJRIl08/RmKH 2OF6n6SW1jXxIpwFHmMhdzh/5cq4hpDqhoODNzi/6ZDjRTzBKbFR5d395ZHr39qmIIG8 S1DtY0R3hUB93zesIYNkwrUCse40hd4kezZWoJBfe1Wg4PSu4ZsFpU7kHmR1xH9QNRvs BDhpPsFyssZ2ohALobTu/KsDM1CFflA9I80eg2AZL2pcZLZJaYkF+L92uS7+DZsqHAJ4 5uHQ== X-Forwarded-Encrypted: i=1; AJvYcCWVGp7nggq5tCOn536VG1KCzv3d5X01t+egptN1bvbr0j2pEDTdUv6aXXeQZYY5V4s9LEQ2eSFs22A=@lists.xenproject.org X-Gm-Message-State: AOJu0YyYyzQDcCcL8p7qMFffDUcb1LPsyUXG2Bidnb1zHyH4+3lRfRT2 9zCFyAJPGhJPjRwXusXcbNoJslsIrlys4WeO10zLaMdF9lYixAWn4xDlZH3RD98= X-Google-Smtp-Source: AGHT+IHB3u2/l2rZG0k9ZOUXZliIL+D2FSwQjxK7a12SP+D4OKLAIj7VApFTPwlDLTNgD+mrpxyQ9A== X-Received: by 2002:a05:6214:5004:b0:6d4:2778:ecb6 with SMTP id 6a1803df08f44-6d4377a118bmr7865406d6.18.1732051008401; Tue, 19 Nov 2024 13:16:48 -0800 (PST) From: Alexander Merritt To: v9fs@lists.linux.dev, linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org Cc: Eric Van Hensbergen , Latchesar Ionkov , Dominique Martinet , Christian Schoenebeck , Simon Horman , Juergen Gross , Alex Zenla , Alexander Merritt , Ariadne Conill Subject: [PATCH] 9p/xen: fix init sequence Date: Tue, 19 Nov 2024 21:16:33 +0000 Message-ID: <20241119211633.38321-1-alexander@edera.dev> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @edera.dev) X-ZM-MESSAGEID: 1732051087536116600 Content-Type: text/plain; charset="utf-8" From: Alex Zenla Large amount of mount hangs observed during hotplugging of 9pfs devices. The 9pfs Xen driver attempts to initialize itself more than once, causing the frontend and backend to disagree: the backend listens on a channel that the frontend does not send on, resulting in stalled processing. Only allow initialization of 9p frontend once. Fixes: c15fe55d14b3b ("9p/xen: fix connection sequence") Signed-off-by: Alex Zenla Signed-off-by: Alexander Merritt Signed-off-by: Ariadne Conill Reviewed-by: Juergen Gross --- net/9p/trans_xen.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/net/9p/trans_xen.c b/net/9p/trans_xen.c index dfdbe1ca5338..0304e8a1616d 100644 --- a/net/9p/trans_xen.c +++ b/net/9p/trans_xen.c @@ -465,6 +465,7 @@ static int xen_9pfs_front_init(struct xenbus_device *de= v) goto error; } =20 + xenbus_switch_state(dev, XenbusStateInitialised); return 0; =20 error_xenbus: @@ -512,8 +513,10 @@ static void xen_9pfs_front_changed(struct xenbus_devic= e *dev, break; =20 case XenbusStateInitWait: - if (!xen_9pfs_front_init(dev)) - xenbus_switch_state(dev, XenbusStateInitialised); + if (dev->state !=3D XenbusStateInitialising) + break; + + xen_9pfs_front_init(dev); break; =20 case XenbusStateConnected: --=20 2.43.0