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

Allow filesystems to set atomic_o_trunc flag #167

Merged
merged 4 commits into from
Oct 25, 2024

Conversation

sbauersfeld
Copy link
Contributor

This PR implements the atomic_o_trunc flag during the fuse init protocol.

When this flag is enabled, application calls to open with the O_TRUNC flag will cause a FUSE OpenFile op with the O_TRUNC flag set. In comparison, the default behavior is an OpenFile op without O_TRUNC, followed by a SetInodeAttributes op with the target size set to 0.

Ref: torvalds/linux@6ff958e

@sbauersfeld
Copy link
Contributor Author

Hi @stapelberg, I'd appreciate your review on this change when you get a chance. I tested the new version of this library with our fuse filesystem and the atomic_o_trunc flag worked as expected. I also added some unit tests. Thanks, Scott

samples/memfs/memfs.go Show resolved Hide resolved
@stapelberg stapelberg merged commit 8ccd611 into jacobsa:master Oct 25, 2024
3 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.

2 participants