JFFS2: truncated files after power loss scenario

Albrecht Dreß albrecht.dress at arcor.de
Sun Feb 6 12:12:32 EST 2011


Am 06.02.11 17:03 schrieb(en) Artem Bityutskiy:
> The bottom line is that it is difficult to fix broken applications by
> changing JFFS2. The right way to update configuration files is described
> here:
> http://www.linux-mtd.infradead.org/faq/ubifs.html#L_atomic_change

Dumb question: isn't it necessary to also run sync() after the fsync() - close() - rename() sequence, as to ensure that the directory entries are actually flushed to the flash?  Or does a call to

	rename("configfile.tmp", "configfile");

*ensure* that after a crash during this call either the entry of the old file (configfile) or of the newly written contents (configfile.tmp) is accessible, independent of the moment when the crash happens?

Best, Albrecht.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20110206/25affc8f/attachment.sig>


More information about the linux-mtd mailing list