Skip to content

mount_fd: Manually manage mount file descriptors

Sebastian Hasler requested to merge haslersn/virtiofsd:mount-fd-manual into main

Still we have a hash map of all existing mount FDs. But instead of refcounting mount FDs and letting them remove themselves from the map, we manually

  • add a mount FD when the (sub)mount inode is looked up, and
  • remove a mount FD when the (sub)mount inode is forgotten.

When later implementing FUSE_SYNCFS for the case without --announce-submounts, we need to defer removing mount FDs until syncfs was called by them. This can be done by either (a) calling syncfs on any mount FD that is about to be removed, or (b) keeping them until the client calls syncfs. Both ways ((a) or (b)) are easier to implement on top of the manual management introduced in this commit.

This MR is an alternative to !73 (merged).

Edited by Sebastian Hasler

Merge request reports