Re: about ubifs

Corentin Chary
2009-06-05T12:42:21Z

On Fri, Jun 5, 2009 at 2:13 PM, tommy<jiujin.hong@mid-fun.com> wrote:
> Dear all,i have found a question about ubifs and sync !
>
> Question is following;
>
> Artem,
> What i do is just open an existing file in a UBIFS formated UBI volume
> on a Nand Flash,
>
> add a few lines to it ,close the file ,then without unmounting the
> filesystem and reboot the filesystem.
>
> When my board reboots and i looked at that file ,it's zero length and
> has no contents.I suspect it's because
>
> UBIFS does less frequent syncs .it just lost content of the file because
> there's no sync before the reboot!
>
> How can i solve this ?
>

Hi,
Do you use fsync() before closing the file ?
You can read http://thunk.org/tytso/blog/2009/03/15/dont-fear-the-fsync/
for more information. It's for ext4, but I think the problem is the
same.

--
Corentin Chary
http://xf.iksaif.net - http://uffs.org