LWN.net Logo

ext4 and data loss

ext4 and data loss

Posted Mar 12, 2009 20:04 UTC (Thu) by samroberts (subscriber, #46749)
In reply to: ext4 and data loss by bojan
Parent article: ext4 and data loss

"If you really care to make sure something is on disk".

There is no class of applications that write data to a file and don't
expect it to be written to disk.

For a long time fsync/O_SYNC were essentially no-ops on linux, the
attitude of the kernel developers being "apps call write(), the kernel
will put it on disk when its efficient to do so" and "linux is not a
real-time OS". Now Ted is calling such applications "badly written"? B.S.

That said, I sympathize with him about user's whining that data is lost
when their OS crashes. If your operating sytem crashes, you lose all
guarantees that it worked. Such is life. Either use an OS that doesn't
crash, or run filesystems in real-time modes that write data to disk as
soon as possible after the app does the file write, and live with the
performance loss.


(Log in to post comments)

It seemed to work fine

Posted Mar 12, 2009 22:46 UTC (Thu) by man_ls (subscriber, #15091) [Link]

Or... stay with ext3?

It seemed to work fine

Posted Mar 12, 2009 22:54 UTC (Thu) by man_ls (subscriber, #15091) [Link]

... which is of course your second option. Sorry, not having enough coffee these days.

ext4 and data loss

Posted Mar 13, 2009 14:45 UTC (Fri) by jbailey (subscriber, #16890) [Link]

It's not a matter of expect to be written to disk or not, it's the performance tradeoff versus data security should it not be written to disk. An MTA must make sure that it's committed to disk because it's irretrievable if it's not. A word processor autosave, not so much. Non-error log files, same thing.

My machine has certainly been writing things to disk all while I'm reading lwn here (logs, browser cache. If I were at home, it could be bittorrent, etc). My life wouldn't be any poorer if the system were to crash right now and none of that were recoverable.

ext4 and data loss

Posted Mar 13, 2009 22:47 UTC (Fri) by bojan (subscriber, #14302) [Link]

> There is no class of applications that write data to a file and don't expect it to be written to disk.

Any application that uses temporary files is OK with data not hitting the disk.

ext4 and data loss

Posted Mar 17, 2009 21:56 UTC (Tue) by pphaneuf (subscriber, #23480) [Link]

"No class of applications", you say?

/var/run being on a tmpfs makes sense (if we crash, then it's okay, they're not running anymore).

Another more practical one is my browser cache. If it got blown away on every reboot, I wouldn't really mind, and I would actually be pretty angry if my browser started doing fsync on every little thing (hmm, where have I heard this?).

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