cloud-hypervisor / fuse-backend-rs

Rust crate for implementing FUSE backends
Apache License 2.0
129 stars 63 forks source link

Add the ability to clean up the dentry cache can be used to clean up resources when VFS umount. #152

Closed zyfjeff closed 9 months ago

zyfjeff commented 9 months ago
  1. In order to make the hot upgrade of virtiofs easy, VFS will save pseudo inodes when umount for easy recovery. However, in the fuse scenario, if umount does not remove the pseudo inode, it will cause an invalid directory to be seen on the host, which is not friendly to users. So add this option to control this behavior.

  2. umount returns the parent's inode information, so that it is convenient to call fuse's invali entry interface later to clarify the corresponding dentry cache

  3. Use the invalidate entry provided by the fuse kernel to clear the entry cache, all code references the libfuse implementation.

  4. Optimize log output and print in vfs umount scenario

    1. optimize the log of forget, for scenarios where forget cannot handle when the vfs submount is dropped by umount.
    2. remove the error log printed when write fuse fails, and hand it to the caller to process and print.

Signed-off-by: zyfjeff zyfjeff@linux.alibaba.com

ref: https://github.com/libfuse/libfuse/blob/f44214be6a2abb4c98f61790cae565c06bdb431c/lib/fuse_lowlevel.c#L2332