[Fontconfig-bugs] [Bug 103237] FcCacheOffsetsValid() couldn't detect broken cache file

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Nov 14 11:39:47 UTC 2017


https://bugs.freedesktop.org/show_bug.cgi?id=103237

--- Comment #10 from Youngbok Shin <youngb.shin at samsung.com> ---
> Hmm, does it guarantee the file size?
Do you mean fsync() guarantees synchronization without considering its file
size?
Then, as I know, yes. It writes a whole buffer to the file descriptor at once.
I'll be bad for performance.

I think even if we can see non-zero values at head of invalid cache file, we
still need to consider the file corruption by power outage. If a file system
couldn't create a whole file or write anything on a file by power outage, we
wouldn't call it "corruption".
Here is a Q&A about these scenarios.
https://serverfault.com/questions/403891/journaled-filesystems-and-power-failure


If we can't allow bad performance by calling fsync() for writing the big cache
files (to prevent very very rare file corruption issues), I think we need to
add more validation code. Just like your temporary patch for the issue.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/fontconfig-bugs/attachments/20171114/d8b69384/attachment.html>


More information about the Fontconfig-bugs mailing list