Comment by Too
7 years ago
So if fsync fails, what is one supposed to do? You can't retry it and you don't know how much of the file that has been synced?
Only feasible option is to create a completely new file and retry writing there? And if that fails your disk is probably bust or ejected, which should require user interaction about the new file location. Doesn't seem too unreasonable?
This would require you to have the complete file contents elsewhere so you can rewrite it? Or would it still be possible to read from the original file being in the unflushed buffer? And in the disk ejected+remounted case, the old contents should still be there intact thanks to ext4 journaling?
No comments yet
Contribute on Hacker News ↗