[Yaffs] open files and power failures

Charles Manning Charles.Manning@trimble.co.nz
Mon, 17 Jan 2005 09:18:07 +1300


Wookey has already answered this, but I'll add a bit more.


> Hello anyone,
>=20
> How does yaffs behave if one or more files are open when a=20
> power failure occurs?

YAFFS was designed for use as a highly robust file system for embedded
systems. In my mind, embedded systems by definition mean unreliable
power downs etc.

YAFFS is log structured. This means that changes are written to the file
systems. The structure is built up in RAM at mount/scan time. There are
no FAT tables or similar to get messed up.

>=20
> Has it been tested?

Yes, by many people, and has been shipping in many products for a long
time. There have been problems with the Linux interface, but the core
file system has been very robust for a long time now.
>=20
> Can one risk to lose the files that was open before the power fail?

No. The only time that data from old files gets tampered with is during
a garbage collection exercise.  This is done in a copy-before-delete
sequence so the data is not lost if power is lost during the garbage
collection.


-- Charles