5 ms·
9p filesystem has been added to FreeBSD
- dwheeler 2y agoThis patch uses heuristics that seem dangerous to me: > The 9P filesystem protocol relies on stateful file opens which map protocol-level FIDs to host file descriptors. The FreeBSD vnode interface doesn't really support this and we use heuristics to guess the right FID to use for file operations. This can be confused by privilege lowering and does not guarantee that the FID created for a given file open is always used for file operations, even if the calling process is using the file descriptor from the original open call. Improving this would involve changes to the vnode interface which is out-of-scope for this import. Where would you use something with such unreliable heuristics??
- crest 2y agoFor a read-only filesystem, as a shared directory between guest and host OS for a specific guest (and host) users, etc. It's a significant, potentially dangerous limitation, but it's still worth having in its current form. Touching the VFS interface is easier when the code consuming it is already in the tree and not to be taken lightly.
- falcor84 2y agoCould someone please explain the significance of this?
- bloopernova 2y agohttps://en.m.wikipedia.org/wiki/9P_(protocol) https://en.m.wikipedia.org/wiki/9P_(protocol)
- opless 2y agoIt's a virtio filesystem, so it sends 9p.2000L (probably) down a virtio "pipe" so your virtual machine can access its host filesystem
- ithkuil 2y ago9p is a simple network protocol for implementing filesystems. It originates from the plan9 operating system but its main usefulness nowadays is that it permits people from implementing filesystems in user space without having to integrate deeply into kernels specific interfaces like FUSE. I.e. if your OS can mount 9p volumes you can implement a user filesystem easily by just running some process on localhost and mount it. And it also works remotely (although that's less useful IMO, although not entirely useless)
- crest 2y agoBhyve (FreeBSD's native hypervisor) already contains a 9P over VirtIO "server". The protocols allows virtual machines and their host to share a directory instead of block storage without having to configure and use a network filesystem like NFS. It's even bootable as in the UEFI BootROM should be able to read the bootloader via 9P, the bootloader can use EFI boot services to read the kernel (configuration, kernel image, kernel modules), and the kernel can than mount it as root filesystem. This means that use a directory instead of an image to boot a virtual machine. I can imagine a lot of use-cases for this e.g. a CI/CD pipeline that tests an experimental kernel (feature) inside a hypervisor.
- yjftsjthsd-h 2y ago> to share a directory instead of block storage without having to configure and use a network filesystem like NFS. How different is it? I sorta had 9P and NFS as loosely equivalent in my head - both are network filesystems that let you mount a directory from one host to another.
- deleted 2y ago[deleted]
- buggeryorkshire 2y agoGood Lord this brings back bad memories - I used 9p around 7 years ago for a secure government system, it was horrific. I did report the bug, with all the details etc, but it was basically unmaintained. IIRC the issue was it was using up file handles under pressure to a point where the host died. It's a great idea but really hope it's better now.
- yjftsjthsd-h 2y agoMy impression is that it really matters which 9p implementation you're using - for example, it's used in both WSL2 and ChromeOS's VM system, and it seems quite good there. Though equally I'd easily believe that there are terrible implementations running around.