* [PATCH] 9p/trans_virtio: reset device before deleting virtqueue on probe failure
@ 2026-12-03 21:56 Yuho Choi
0 siblings, 0 replies; only message in thread
From: Yuho Choi @ 2026-12-03 21:56 UTC (permalink / raw)
To: Eric Van Hensbergen, Latchesar Ionkov, Dominique Martinet
Cc: Christian Schoenebeck, v9fs, linux-kernel, Yuho Choi
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 <oss.patchbox@gmail.com>
---
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-12-03 21:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03 21:56 [PATCH] 9p/trans_virtio: reset device before deleting virtqueue on probe failure Yuho Choi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox