On Mon, Jan 04, 2021 at 09:30:08AM +0200, Andrei POPESCU wrote:
On Du, 03 ian 21, 19:53:07, Michael Stone wrote:
Applications which need more data integrity
guarantees generally implement some sort of journalling and/or use atomic
filesystem operations. (E.g., write a temporary file, flush/sync,
rename--that guarantees either the old file or the new file will be present,
but not a partially written file.)
Unless I'm mistaken, this is somewhat similar to how copy-on-write works
for every write, except that the copy-on-write is done at block level
and with the added benefits that unchanged blocks are kept as they are
(less writes) and may even be shared between files (using less space).
COW is a different, somewhat related, thing. In itself it isn't
sufficient for an application to be assured about the on-disk state at a
particular time without using additional filesystem operations beyond a
simple write(). In practice, those operations are a subset of what's
necessary for other filesystems and most applications concerned about
data integrity are going to implement the full set. (Few people want
filesystem-specific applications.)