+ * ``IOMAP_ATOMIC_COW``: This write is being issued with torn-writeI think using "COW" here results in a misnamed flag. Consider:
+ protection based on CoW support.
"IOMAP_ATOMIC_SW:
This write is being issued with torn-write protection
via a software fallback provided by the filesystem."
iomap itself doesn't care*how* the filesystem guarantees that the
direct write isn't torn, right?
The fs' io completion handler has to
ensure that the mapping update(s) are either applied fully or discarded
fully.
In theory if you had a bunch of physical space mapped to the same
file but with different unwritten states, you could gang together all
the unwritten extent conversions in a single transaction, which would
provide the necessary tearing prevention without the out of place write.
Nobody does that right now, but I think that's the only option for ext4.