VFS mount rollback for virtio 9pfs
Date: Mon, 11 Jul 2022 13:16:33 UTC
Hi, I am attempting to get the Juniper virtfs code (http://github.com/Juniper/virtfs) working and I have managed to get it to a point where it mounts and things seem to work (https://github.com/DanielO/freebsd-src/tree/9pfs) although I have only tested on bhyve so far (but feel free to test elsewhere :) During the process I found the Juniper code would ask for 9p2000.u but is written for 9p2000.L (I think bhyve is more rigid about what it allows than Xen etc). This was easily fixed but I want to make the handling of a similar error in future correct. The virtfs_unmount code as it stands will fail when the kernel tries to rollback the mount. The end result is the ref count for the file system is not decremented so the KLD can't be unloaded. I attempted to fix this by squashing the return value to 0 in the event of a forced unmount but that results in the mount rollback hanging in 'mntref' while it waits for the mount ref count to go to 0. I assume I am missing something obvious but I can't work out what it is so any clue much appreciated. Thanks. -- Daniel O'Connor "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum