[Virtio-fs] [virtiofsd] MR opened: Check whether the root’s file handle is usable

virtiofs-bot at sinrega.org virtiofs-bot at sinrega.org
Wed Mar 2 18:40:23 UTC 2022


After generating the root’s file handle, try to open it with `O_PATH` to find out whether it is actually usable.  If it is not, disable file handles altogether; in “mandatory� mode, this is just an error, and the filesystem will not be usable.

Similarly, if no file handle could be generated for the root node, disable file handles altogether, because we cannot be certain that they are usable.

**Note and RFC**: This check is done when the root node is opened, which implementation-wise is a very nice place to do this check.  I don’t know whether that’s optimal from a usability POV, though, because this means that the check will be done only when the filesystem is mounted.  That seems perfectly fine for `--inode-file-handles=fallback` (we don’t need to decide before that point whether file handles are usable), but for `--inode-file-handles=mandatory`, it might be suboptimal to only find out at this point that the virtio-fs share will not be usable.

Is it too lazy of me to put this check into `PassthroughFs::init()`?  Should we add a dedicated function for this test and call it from `main()` before `daemon.wait()`?
---
https://gitlab.com/virtio-fs/virtiofsd/-/merge_requests/96




More information about the Virtio-fs mailing list