UBIFS power cut issues

Artem Bityutskiy dedekind1 at gmail.com
Tue Sep 8 02:22:16 EDT 2009


Hi,

sorry for late answer, was very busy.

On Wed, 2009-09-02 at 17:35 +0800, JiSheng Zhang wrote:
> If we cut power when copy file into ubifs, then remount ubifs and try
> to read the file, we found that the data at some offset of the file
> began different from the data of the original file at the same offset.
> Is this a bug of ubifs?

This is expected behavior on any asynchronous FS. You may switch to
synchronous behavior with '-o sync' mount option. I wrote a lot of
docs about write-back and the related issues. Dig UBIFS docs and FAQ.
E.g.:

http://www.linux-mtd.infradead.org/faq/ubifs.html#L_empty_file
http://www.linux-mtd.infradead.org/doc/ubifs.html#L_writeback

If you have a _specific_ question, feel free to ask, of course. But
for this general question I do not have a better answer than RTFM
:-)))

> PS:how do you test data integrity of ubifs under power loss?

We mostly checked it using either 'integck' (see mtd-utils) or
'fsstress' (see LTP). We ran those tests and cut power off at random
points using these devices:

http://www.cpscom.com/gprod/ipn.htm

Then we mounted the FS. We did not really check the contents of the
FS, because it is not simple and tricky, but we checked that it mounts,
re-mounts, and files are readable/writable/deletable.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)




More information about the linux-mtd mailing list