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
Driver seems to cache file content after file descriptor closed #1008
Comments
Files can be mapped to memory by calling
Furthermore, macFUSE reuses file handles. This is the result of differences in the VFS layer between Linux and macOS. When the macFUSE kernel extension receives an open request it checks if there is already an open file handle for the file with compatible
macFUSE relies on the kernels Unified Buffer Cache (UBC) mechanism. UBC is required for supporting |
Hi Fleischer , thanks for your reply! |
Another question maybe is it possible for MacFUSE to distinguish between |
That's correct. Caching can be reduced to the bare minimum with the
Unfortunately, this is not possible. The macFUSE kernel extension receives open and close callbacks, but there are no file handles on the VFS level of the macOS kernel. macFUSE could pass along every open callback to your file system daemon. But when the macFUSE kernel extension receives a close callback, it has no way of knowing which of the open file handles needs to be closed. I'm not aware of any way to resolve this. The only sane way of dealing with this is reusing file handles and implementing a use counter. In case you are looking to prevent certain processes from opening a file on your volume, you might want to look into the Endpoint Security framework.
This is not possible. It would be possible to implement some special handling of copy operation on the volume itself but not when crossing volume boundaries. |
I'm trying to use MacFUSE to achieve automatic decryption of a file system: when a user attempts to open an encrypted file, I will return another file descriptor of the decrypted file in the
- (BOOL)openFileAtPath:mode:userData:error:
to allow the user to automatically open the decrypted file.Then the decrypted file's descriptor will be stored in userData.
But after the
- (void)releaseFileAtPath:userData:
called and the decrypted file descriptor closed, then I tried to copy the encrypted file outof MacFuse filesystem, I'll copied the decrypted content out.When a file is copied from the MacFUSE file system to the Apple File System (APFS), are the contents of the copy controlled by MacFUSE? Is there any caching mechanism here?
The text was updated successfully, but these errors were encountered: