-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
content-files: call open() with O_TRUNC
Problem: In content-files, most files are created using a hash of the data. So in most cases the filenames are unique. However, the kvs-checkpoint.put rpc will typically write to the same file over and over again. In the event the file already exists, content-files did not clear the data in a file before writing. This can lead to corrupted data if the user wrote fewer bytes to the file than before. Solution: Call open() with O_TRUNC to truncate the file before writing new data. Add tests increasing / decreasing checkpoint data size.
- Loading branch information
Showing
2 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters