User: Password:
Subscribe / Log in / New account

ext4 and data loss

ext4 and data loss

Posted Mar 12, 2009 16:14 UTC (Thu) by nye (guest, #51576)
In reply to: ext4 and data loss by jamesh
Parent article: ext4 and data loss

This seems both very clear, and so obviously wrong that I must have misunderstood.

Are we really saying that ext4 commits metadata changes to disk (potentially a long time) before committing the corresponding data change?

That surely can't be right. Why on earth would you write metadata describing something which you know doesn't exist yet - and may never exist? Especially when the existing metadata describes something that does.

Perhaps what we're really saying is that ext4 does them in the correct order, but doesn't use barriers by default and hence they sometimes get written by the device in the wrong order? That would make more sense at least.

This is really confusing me.

(Log in to post comments)

ext4 and data loss

Posted Mar 13, 2009 0:31 UTC (Fri) by nix (subscriber, #2304) [Link]

That's exactly what it does. Patches recently committed to the mainline
cause the blocks to be aggressively flushed if the file is closed and was
originally opened via O_TRUNC, or if the file is renamed on top of another

(I'd prefer it to delay the metadata operation as well, but apparently
that's really hard. Knowing what a nightmare it is to get rename() right,
I can understand that doing it lazily might not be anyone's cup of tea.)

ext4 and data loss

Posted Mar 22, 2009 22:01 UTC (Sun) by muwlgr (guest, #35359) [Link]

I would not say "aggressively flushed". As I understand, blocks of these files (created/truncated, then closed, or renamed to replace previous file) are just explicitly allocated (triggering all necessary metadata updates to be then written in the correct order).

Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds