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

Fill gaps with NIL bytes when skipping beyond EOF #129

Closed
overheadhunter opened this issue Apr 26, 2022 · 0 comments
Closed

Fill gaps with NIL bytes when skipping beyond EOF #129

overheadhunter opened this issue Apr 26, 2022 · 0 comments
Assignees
Milestone

Comments

@overheadhunter
Copy link
Member

In some scenarios a 3rd party process may decided to write to a file of size N at position N+M. This is a legitimate call where it is expected that the file grows automatically.

For quite a while we had the false impression that it doesn't matter whether the "gap" is filled with NIL bytes or if we can just add some random garbage and decided to do the latter (see 80162fd). Up until some recent changes (#125) this didn't make any difference, since we used freshly allocated ByteBuffers, which are initialized with NIL bytes.

This change in behaviour led to a bug (cryptomator/cryptomator#2205) that proved our assumption wrong: There are third party processes that rely on gaps being nilled: Apparently a plain "cp" under Linux is optimized to skip empty parts in sparse files.

@overheadhunter overheadhunter added this to the 2.4.1 milestone Apr 26, 2022
@overheadhunter overheadhunter self-assigned this Apr 26, 2022
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

No branches or pull requests

1 participant