A way to do atomic writes
A way to do atomic writes
Finding a way for applications to do atomic writes to files, so that either the old or new data is present after a crash and not a combination of the two, was the topic of a session led by Christoph Hellwig at the 2019 Linux Storage, Filesystem, and Memory-Management Summit (LSFMM). Either they use “weird user-space locking schemes”, as databases typically do, or they write an entirely new file, then do an “atomic rename trick” to ensure the data is in place. Toward the end of the session, Ts’o said that he believes ext4 will get the atomic write feature as well, though it will be more limited in terms of how much of the file can be updated prior to a commit.
Source: lwn.net