strange behaviour with p9fs vs zfs

From: Lexi Winter <ivy_at_freebsd.org>
Date: Tue, 22 Jul 2025 05:07:08 UTC
hello,

i've noticed some odd behaviour in p9fs that might be a bug.  this is on
main ~29af6d2e2ec9fe8df7cf1e1a0bf3597028831b18 on amd64.

on the host, i have a basic ZFS hierarchy:

# zfs list -r zroot/p9test
NAME             USED  AVAIL  REFER  MOUNTPOINT
zroot/p9test     400K   682G   112K  /zroot/p9test
zroot/p9test/a    96K   682G    96K  /zroot/p9test/a
zroot/p9test/b    96K   682G    96K  /zroot/p9test/b
zroot/p9test/c    96K   682G    96K  /zroot/p9test/c

this is exported to the VM via bhyve -s 6:0,virtio-9p,p9test=/zroot/p9test,ro

inside the VM, i can mount the filesystem:

# mount -tp9fs p9test /mnt

however, while the top-level directory looks fine, all the descendent
mountpoints appear to be copies of the top-level directory:

# ls -i /mnt
34 a	34 b	34 c
# ls -i /mnt/a
34 a	34 b	34 c
# ls -i /mnt/a/a
34 a	34 b	34 c
# ls -i /mnt/a/a/b
34 a	34 b	34 c
# ls -i /mnt/a/a/b/a
34 a	34 b	34 c

i would expect them to either appear empty (unhelpful, but at least
correct) or else for p9fs to traverse into the descentent filesystem
(much more helpful).