From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.160.54 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796335134; b=T3PIhUHBkj+uQK8+ZYO8/ciovqes/1ch0E0SgHAgClgtjSYE+eNg9FzgqIuTY8WVt3os uQbttRvWLH0yJVFYqW2GEeXViWnFxCGsp1T4URyYmzYlaTn7DUDvXgCo6fOQ8qq51ykwF ZeQEiKrDYtMFYgXb6WNi9MfWHLiX0n8Ehpzg2fTpK9RlRVtNe4tLH4GH1en6I2jSOWEbk +0D4dGPgxFENdNUNltkGS4LWC7Woy18/Zx9xsrvqznVgJkLG35hXqLTTErvvArXCWCwH2 KUQ6qVTu3Gdl5Ibocb8eRKUmfvE149DZXf/LXPePUvKYdC+hCzN93BGhDajMv7G6Ogg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796335134; 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=PxFB/cz5H44gFJQONqXsEwJ2JZknY6szK9kQmRAOxaRLdId5qVRDnFOt+pk56XQn65Yn iJFjT4NcyGBRK9WbLunFbkk7tm+3xmegsx+pCz8gORx3f9/dfV2oWq8BBPmDerY7v8xJg gWg0Du2neHSLNyWanNP/8plISdMzKYx89AQGOMmtrS9uPFb/eRuv7vG7g3MFX++pbr5zw Rg7EtBxb/N3bQ0SQxpitn4o1sy/+NsL+RVVgcY6aqWmwORQbceMl1HFP6s/ssGqH7mu69 /XG4mDpiluWJq6KfjZeIRvPUXaXKS6gSyhdOlJjy7gUbIKiwg5ph8GGWxF/M1I91VpQ== 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=UJNI4gEV; arc=none smtp.remote-ip=209.85.160.54 Received: from mail-oa1-f54.google.com (mail-oa1-f54.google.com [209.85.160.54]) (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 F1DAC606A32D for ; Thu, 3 Dec 2026 21:58:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org F1DAC606A32D 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=UJNI4gEV Received: by mail-oa1-f54.google.com with SMTP id 586e51a60fabf-49429181ce9so194090fac.0 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=lists.linux.dev; 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=UJNI4gEVpmbHAj5xuOhwIEiMt3JOlcQdA0aSFYFF+0DqcnoV2jdsDS/hX7OFslecXz D8w95Zkq3by5fKkjLEx4kn9mSOeW4G605axdK4aIouxQszJb2Biz0VGillgt+pJCfBdH uxFXH3TxmcaXjqETXOz/XfrvLv8ZgAIIxmbgqYvNuZx473W1m+yri2IcAHLIDtkbcgnH 289rZf6jXKB8pK+qX6edmx+zembOFfVSBMoBjEEGEtQFOFIPne9TC9NNljTpUSh5xv1s 4DE2Xo8oTimHxBzg9q/fp4swlpdsBwRDfAXWC+UyQd1Stz5bYmcrd2P9upr548a1iajz 46xw== 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=xYbMPdNvF5vVxv+7vja+9e88HFu2GFft0loiFMANLYCGsRYEuIyQlcQLs1kCG5I8AF +QO/rwsnJR7Dj9yT0jrs5QcvKIJ8EM2QoNcZxd6zSq0wKj3mFZrmue3GcHPl17gKcjSu qUkwf9cdDqzz/0OxQs2pBp6NW/TwMm9GNK54blbGzQzKmwUYtMH4frz20iH3Ihj4JLkg QDP9cO2sG+MLtGDGjkoOChNxLzSYcjW5LDbUu8/XAyLPWVAkZFvHgDC7RElHdDYXkqli IKJda62HI0oeOphwtyKi0hd0chZJ1bSDrNNGcvqGC602TgqJ4kk/TtVR3g/cep38xfVK 6yIw== X-Forwarded-Encrypted: i=1; AL+hErEMu6cymeTGmtRtG3vG/b3b7wTlap9odWEUVHd+IOEEcP8OvsOMxNovrC5ig90X8yG03AO9@lists.linux.dev X-Gm-Message-State: APuU4Z87hYAIUL6th04aPImbb2Vws3rnD1FP0QthEQURA2W1sfqQkHaW IG5402nWNuxL4cQaiNbMPd/FjIQpXXYM5tPwN4mTV496++b/bFNN4XY+ X-Gm-Gg: AZFdTZd8BvpRjyapKcBlTQegYczmUEOyJ3N39aXeHM4xt95a9xEKXVxmh5j3EpcuQOm S4EUCmbXsD3gDlA+cpOLh32mh43SZnt9Q9DhVHdTleiPtsJheakRUilGtAw7gDf5rhENBkY7Xct U/xNP+nKxqbN4uvfmJZFBXaeFml8EXPxQ+LnfHbXgoM3pjF1jBQFeT9hh4uqk2HD+vIR55uXOEl rAecX/WSR8UXgUXPdsDrvoeOcHt0AHwgmyd7kkP7AEpNf8Vzvzb10pJ3gtVL/B6RNPzMT2qEVd5 8m6uTf+2Oify+KHBJbrHU5d+xmiEXKXXs3IU9X1T5YN5pWdlX79LauZADywO2Tr1yScMynSjef3 3Kla2XC4dscIil5jkBHonUJa+LnYH8CYeDUtNR7NceC0u72YzjK/qJ11g8E7ZvwF+Sjyfcdu84I JgARvfw5lx2C0+ZZA0F4/JorYqWnSgmp58ozb7X52lcw3NKzrHgp2w19D0+Qo9T8eMkr47oOVs4 tvlLa7HzwmrUQxKsKVkLgleZDkfp8I7mKoEvBJJejrMd/Ci0fkMY7/ntybFtBum36xn1GUaJKQO WHdMF0FSbpd+p29jnDCc5ohLd7D3iIfZPcWK5gsHcxA7csDxKdaQ1c25Lz/bEqAIMUrhhbCJIJN t2IX8LeHJjwNQwJGc1fckMZclhPJCg7ER2v9BUoAh6x3UQFfW9nC/851/2TW7mn9H6dU= 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: v9fs@lists.linux.dev 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