From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.160.46 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796335133; b=vbXPqXcJvawJsI5sI4mWASlAtmyA+kBJ0Ho56HXbP+Tyl2y8sOGpYnB7xUrTRd5i2u5j 4+ss/5XmzxQDu/49YMYm6ou9vbIQMLiG8CFnwpO4cLf1VWscDjL2+sYtHtBkgwOx76RHq EPxMY/2vaM5nOtEkmDWnV3G9NbUw+h5AF36AOiRenfeVI1O2qbN9KpVKgjvM/RES3bB+X yHfaW7x9m1GtLYgtp0MLe+dLdpYmiDF0HuiXqSI3liOfomM5+KmQdeilZ0Jepyxg8i9IJ qv79KEsFmaMmA/uv8x/UOl2wTllvTaVg6Nz7dZt7QET+r4umOXZCo9SjKeQBWm2DapQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796335133; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=9fI5SW3MpGKZmlPwIDJMHq/UW0u/AYqOdmlBCEPsFm8=; b=Sd1RsxufuBW8WbUIVCqAc3Sm2OK9mjKYfa4N6crs3pCvL1gGs9Sqp/YBzCIIGnhayXCH yHs6bHV0RFaHJ84+bGAQKdBGnu59C+7mizr3X+hSmGo/+phLLQ3WERwKzY3ZloOSoCBhS 90QrpHkQ/kPWwoxHlid8LT4z+U3JgD9t8sBT7VATEh1K3Vc7BajQPHuA4DOaDS1w/K7FZ MCbcXBnsrQj5L4oXovw5NtP39L97ZL4gZCZt1ImxS3D48evS0S8KutfuDtvePTyjkgRpS ojrdE+rbY0Ga5l4/VqIe9rHcqXWdGcIp16ry9+PuNTaMHlqFKOQAxhWBWMyLs9XRwRw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=H1xS2jHH; arc=none smtp.remote-ip=209.85.160.46 Received: from mail-oa1-f46.google.com (mail-oa1-f46.google.com [209.85.160.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 72B4A606A322 for ; Thu, 3 Dec 2026 21:58:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 72B4A606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=H1xS2jHH Received: by mail-oa1-f46.google.com with SMTP id 586e51a60fabf-48ed0b68895so207272fac.1 for ; Thu, 03 Dec 2026 13:58:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796335132; x=1796939932; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=9fI5SW3MpGKZmlPwIDJMHq/UW0u/AYqOdmlBCEPsFm8=; b=H1xS2jHHH4NaB4Y7UKlRnoRczvOvhFukFj/CgymL8coKofahAOe3IHLohXVJUQ/3Pt I4WMwLLtIh/+EEvjc/jUuu5vgRNXYBvCGvNx6Pygx7v+e4r3eL3x+9liErEgnXuvplXk nVmNtncpW+sVfiWOF0XpygRkpgvTIdOH0HoM8yRh2k+6Yy2QlaCuTbxt14yHZQGyOACQ CAWzuDO1ADZJThiNH/gwgbZCZn7+Z0cBBhZ8yzhkO4oebSq1MMHKjcSr47vBJrd0dc4W iRl3NBZWUhUlnTqe/Gbh/Q7lKcxcOJQhbMC8hoA6pGhvnWQm0lkg9bOrkQexTcP0jqRW ueNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796335132; x=1796939932; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=9fI5SW3MpGKZmlPwIDJMHq/UW0u/AYqOdmlBCEPsFm8=; b=XcUy18yK+R3RKsWftH8lX3DbaFVtfb8LlZOykT4yAOqze+7NF+wXCGngbZ/ct2gaRR E06ubK+pIzoKYJY+O6oDprWvIum3JS2dJG2wkZm4DA4hQI2vMdTT7pqTb328JaaLTesO /s4FRl+G0ImUK3fGy/HoI8kHkS0XMJT6G3X5meWGRdO3cXdVeyoYrn3FaK1+3an+yuyM uxSXedULw9G9KMU2kQ7FNN87RjXu9+kDOHSciO/h8CVDrgggW2tpMh4uKy7olcmP1CbJ +YDwlmer0KP27a1DsOyr3ARW0TzKfpUvEaqygKz4CVz0ybppwl+bl/x4oETVC/lVkrxj 0J5Q== X-Forwarded-Encrypted: i=1; AL+hErHd7eef+3l0gTiv0V3jgiHWlNZ6lfxJVn+iCX2hgM9K+ztL1p6DKd+475FPvOQu6nqjgztouWF6quS+K+0=@vger.kernel.org X-Gm-Message-State: APuU4Z8xZ3q6OJxQzQs57gAYUWRH0LBSfROxHuQ/OksUT295xPLJVuJk dwkh6ErvZBF5+ohKloUhqNTS7xqR0bxcGaCStCqobyYL+IkqPHmzkhbmZfXbIA== X-Gm-Gg: AZFdTZdcW9MHOrp9akNyh+Cs3kqJjMZIHp53jFj1pQUh81JE0ofOVyIZRbHOhF3XjU6 Qxi5CFhJyVsSlEDToFGQh6GbCEkQ9784CWjWLEtKRo1iWiuVko8L7aY6052SxR3HGFM8DtMfODG 68I0swjvMStgHLpBYFg0tRNOonbefDkTR3btOZXK3j6lp8czLHEcVqk5XYjWCmGiqHPS3TFebqR V6mzSs8NJJtEUUYc8vZ6rCG344OVWQyTjc9Nspx81qnXVMdRAOAWgg8ii1vohhv2eVRfZs0kW67 cXiVXFA6rqfpzmNTsU3FGDGlzSRG9uKLP+YIq77W7xcImjZJ24LdaCjJuOVoXqsBqPcCewZguqW wDiDq/EperDMzMG2tTdFr/Xg5TBH90H4i4KZedKdPdb4IN6Ws1imDWB3IlKY8sYeRe644JOLKea hXu2ovS9JIO9/Yl9IvN4KGLrcWTvq7KoLbojWCoFp5z2RbKGAGzFRHMv+qe7hoqY5rCSr6eGxhe 1SJj+GTuJPuox2mVQAjdI32P3jjSEGuwxODKzBgo2QNO3F3gfKCSwlRcdEVL1XGU3lMiW6Ki0mt T6QCGHdfQGrOTIgJCrGa16WOlmCDfnHJEI91siIwdRBUNEPVjVAUDHFpZUPHxTglOlw1eRVDZCh Z5WHLqqCJB67IlOBPJX6i0Z0lJmT1egzzdfBbQ2M5uoAyjlKig4NazkVhSmFNpW+XRm4= X-Received: by 2002:a05:6820:571a:20b0:716:caab:5347 with SMTP id 006d021491bc7-71b395cf748mr27692874eaf.75.1796335132451; Thu, 03 Dec 2026 13:58:52 -0800 (PST) Received: from tempest-testimage-cc-centos9-stream-server-1191361818 (chi-dyn-129-114-108-164.tacc.chameleoncloud.org. [129.114.108.164]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-71bef137524sm928541eaf.11.2026.12.03.13.58.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 13:58:51 -0800 (PST) From: Yuho Choi To: Eric Van Hensbergen , Latchesar Ionkov , Dominique Martinet Cc: Christian Schoenebeck , v9fs@lists.linux.dev, linux-kernel@vger.kernel.org, Yuho Choi Subject: [PATCH] 9p/trans_virtio: reset device before deleting virtqueue on probe failure Date: Thu, 3 Dec 2026 21:56:18 +0000 Message-ID: <20261203215847.2322040-2-oss.patchbox@gmail.com> X-Mailer: git-send-email 2.56.1 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit When p9_virtio_probe() fails after finding the virtqueue, it deletes the queue without resetting the device, and the virtio core does not reset it after a failed probe either. On virtio-pci modern the queue then stays enabled, so every later probe of the device fails in setup_vq() with -ENOENT and the share can no longer be mounted. Reset the device before deleting the virtqueue, as p9_virtio_remove() does. Fixes: 97ee9b025740 ("net/9p: Use the tag name in the config space for identifying mount point") Signed-off-by: Yuho Choi --- An LLM helped me write and run this reproduction test. Tested on 9p-next 45cf2b26cf26 in a QEMU/KVM guest with virtio-9p-pci. A test-only module parameter made p9_virtio_probe() fail once, at the tag allocation or at the vc_wq allocation, and the device was then bound again through sysfs. Without this patch every bind failed and the share could not be mounted (3 of 3 runs for each failure point): 9pnet_virtio virtio0: probe with driver 9pnet_virtio failed with error -2 mount: mounting host0 on /mnt failed: No such file or directory With this patch the first bind succeeded each time and the share mounted. net/9p/trans_virtio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c index 9fa63e3ebf67..a75ea075f781 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c @@ -677,6 +677,7 @@ static int p9_virtio_probe(struct virtio_device *vdev) out_free_tag: kfree(tag); out_free_vq: + virtio_reset_device(vdev); vdev->config->del_vqs(vdev); out_free_chan: kfree(chan); base-commit: 45cf2b26cf260ce66b89c390245579527ae60782 -- 2.56.1