Garrett: ext4, application expectations and power management
Garrett: ext4, application expectations and power management
Posted Mar 18, 2009 7:54 UTC (Wed) by malor (guest, #2973)In reply to: Garrett: ext4, application expectations and power management by smoogen
Parent article: Garrett: ext4, application expectations and power management
Even if disk spinups were once every five minutes instead of every five seconds, you would still get that behavior; all the data blocks of a given file would be written to disk before that file was renamed over another one.
This means that you're guaranteed to always have either the old data OR the new data. You don't know which you have, after a kernel crash or power failure, but you have one or the other. And this happens without needing to do an fsync, which is a different logical thing, and which absolutely requires a drive spinup. This sync-and-rename functionality is much lighter weight, and can happen pretty much anytime. It doesn't add to the power burden of using the disk, but still guarantees a form of data integrity that many applications find very useful.
Either good old data OR good new data is not the same as fsync. Telling programmers to use fsync is forcing them to use the hammer that's convenient, instead of the screwdriver that would better solve the problem.
