All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] 9p/trans_virtio: reset device before deleting virtqueue on probe failure
@ 2026-12-03 21:56 Yuho Choi
  2026-12-03 22:15 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages 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] 2+ messages in thread

* Re: [PATCH] 9p/trans_virtio: reset device before deleting virtqueue on probe failure
  2026-12-03 21:56 [PATCH] 9p/trans_virtio: reset device before deleting virtqueue on probe failure Yuho Choi
@ 2026-12-03 22:15 ` sashiko-bot
  0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-12-03 22:15 UTC (permalink / raw)
  To: Yuho Choi; +Cc: v9fs

> 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>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261203215847.2322040-2-oss.patchbox@gmail.com?part=1

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-12-03 22:15 UTC | newest]

Thread overview: 2+ messages (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
2026-12-03 22:15 ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.