Ext4 breaking the promise of data=ordered ?
Ext4 breaking the promise of data=ordered ?
Posted Mar 31, 2009 20:57 UTC (Tue) by mfleetwo (guest, #57754)In reply to: From ext3 to ext4: An Interview with Theodore Ts'o (Linux Magazine) by sbergman27
Parent article: From ext3 to ext4: An Interview with Theodore Ts'o (Linux Magazine)
The ext3 FAQ says this about data=ordered:
"mount -o data=ordered"
Only journals metadata changes, but data updates are flushed to
disk before any transactions commit. Data writes are not atomic
but this mode still guarantees that after a crash, files will
never contain stale data blocks from old files.
It seems that Ted Ts'o comments in his blog say that because ext4 is performing delayed allocation data will not be allocated to blocks and written to disk before the metadata is written to the journal, thus breaking the exceptation. I would have hopped that before the metadata is committed in the journal, outstanding data for all inodes being committed in the journal are allocated and flushed to disk. With a 60 second commit by default a lot of data can be written. If very large files are being written and fragmentation is a concern then fallocate() can be used to pre-allocate all the space in a single extent as Ted points out in this article. If the user wan't dalayed allocation beyond each journal commit then that is what data=writeback is for.
Posted Mar 31, 2009 21:35 UTC (Tue)
by sbergman27 (guest, #10767)
[Link] (1 responses)
Posted Mar 31, 2009 22:57 UTC (Tue)
by bojan (subscriber, #14302)
[Link]
> Correct. Journaled data mode has the side-effect of maintaining a strict order for data writes, both with respect to each other (ie. writes in a given order will always preserve that order after a crash), and with respect to metadata such as timestamps. That's not a data integrity issue, but it is certainly a consistency issue; Unix semantics basically don't give you any consistency guarantees whatsoever unless the application is requesting consistent checkpoints via fsync/O_SYNC etc; but journaled data mode provides extra consistency nonetheless.
I think more than one person understands the _real_ semantics here.
Ext4 breaking the promise of data=ordered ?
Ext4 breaking the promise of data=ordered ?