3 ms·
I do wonder what happens when a process writes to a memory mapped file, but crashes before the page is synced to disk. Does the write disappear?
by tus88 7y ago
I do wonder what happens when a process writes to a memory mapped file, but crashes before the page is synced to disk. Does the write disappear?
- antirez 7y agoIf the OS is still alive, everything is ok (but the OS may sync different pages at different times and in any order if you don't fsync specific ranges with special calls). If the whole machine crashes (power issue, kernel panic, ...), what you find on disk can be a mess.
- derefr 7y ago> what you find on disk can be a mess Is this "can be" determined by the backing filesystem? E.g., would you expect to get a clean result from a log-structured or copy-on-write filesystem?