Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from
Sep 21, 2023

Conversation

zyfjeff
Copy link
Contributor

@zyfjeff zyfjeff commented Sep 18, 2023

  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 [email protected]

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

src/api/vfs/mod.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/api/server/sync_io.rs Outdated Show resolved Hide resolved
src/api/server/sync_io.rs Outdated Show resolved Hide resolved
src/api/server/sync_io.rs Outdated Show resolved Hide resolved
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.

Signed-off-by: zyfjeff <[email protected]>
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

Signed-off-by: zyfjeff <[email protected]>
Use the invalidate entry provided by the fuse kernel to clear the entry
cache, all code references the libfuse implementation.

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

Signed-off-by: zyfjeff <[email protected]>
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 <[email protected]>
@jiangliu jiangliu merged commit 402e7c5 into cloud-hypervisor:master Sep 21, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants