[Yaffs] Re: open files and power failures

Wookey wookey@aleph1.co.uk
Fri, 14 Jan 2005 15:34:45 +0000


+++ Jacob Dall [05-01-14 11:31 +0100]:
> Hello anyone,
> 
> How does yaffs behave if one or more files are open when a power failure occurs?

Do you mean open for reading or writing?

File open for reading are unaffected by power failure.

Files which are being written to will have the last chunk(s) invalid. The file
structure on the device will remain consistent, but the file(s) being
written at the time of the power failure will not show the latest data.
(i.e. the half-finished inconsistent data is ignored, and YAFFS revets to
showing you the last valid, completed write).

Most of this is just how a log-structured filesystem works.

> Has it been tested?

Tests have been done. I don't have details of exactly what has been tested
by whom.

> Can one risk to lose the files that was open before the power fail?

You will only ever lose the data that wasbeing written during the power fail.

Wookey
-- 
Aleph One Ltd, Bottisham, CAMBRIDGE, CB5 9BA, UK  Tel +44 (0) 1223 811679
work: http://www.aleph1.co.uk/     play: http://www.chaos.org.uk/~wookey/