Re: VFS mount rollback for virtio 9pfs

From: Bakul Shah <bakul_at_iitbombay.org>
Date: Mon, 17 Oct 2022 22:33:07 UTC
On Oct 13, 2022, at 6:01 PM, Daniel O'Connor <darius@dons.net.au> wrote:
> 
> It's come to my attention that someone else also ported this:
> https://github.com/swills/virtfs-9p-kmod
> 
> I was wondering if you would be interesting in trying and seeing how it fairs. Unfortunately I am not in a position to do a test poudriere with it as yet.

FWIW I played with swills port a few months ago. It worked on -12 but
failed on -13 and -current (panics on kldload). I didn't investigate
it further. Tested in bhyve.

Note that bhyve on 13.1-stable does work with a linux guest:
ubuntu# mount -t 9p -o trans=virtio,version=9p2000.L,rw,cache=mmap sharename /opt
ubuntu# dd < largefile >/dev/null bs=1M count=1000
1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB, 1000 MiB) copied, 3.65227 s, 287 MB/s

I took your port & copied relevant files to a -current tree
(8cee2ebac54a). I had to hack a few things to compile[1]. kldload
doesn't crash as with swills port but mount fails:

# mount -t virtio -o trans=virtio sharename /mnt
mount: sharename: Operation not supported by device

Note that the same line works fine on -12, with swill's changes.

Relevant bhyve line:
        -s 8,virtio-9p,sharename=mydir \

Given that mount on ubuntu works seems the problem must be elsewhere
and not 9p2000.L vs 9p2000.u (as you surmised in the original msg in
this thread). I even changed code in the driver to unconditionally
pass 9p2000.L but that didn't help.

[1] Fixed up module Makefiles and had to add 
#define SAVENAME        0x00000400 /* save pathname buffer */
to 9pfs/virtiofs_vnops.c

As only this define from namei.h seemed to be somehow lost.