Re: For UBIFS users: be aware of write-back!

Artem Bityutskiy
2008-10-03T08:11:16Z

On Fri, 2008-10-03 at 08:15 +0100, David Woodhouse wrote:
> On Wed, 2008-10-01 at 08:51 +0300, Artem Bityutskiy wrote:
> >
> > this e-mail informs about a quite important UBIFS feature which
> > have already confused many people.
> >
> > If you use UBIFS, and especially if you have been using JFFS2 before,
> > please, read this documentation entry:
> >
> > http://www.linux-mtd.infradead.org/doc/ubifs.html#L_writeback
> >
> > Please, remember that UBIFS is _asynchronous_ FS. JFFS2 was synchronous,
> > so expect some of your old applications which were fine on JFFS2 to be
> > not ready to handle power cuts correctly in case of UBIFS.
>
> JFFS2 wasn't synchronous on NAND. You still needed to use fsync() as
> appropriate to ensure that written data made it to the flash and not
> just to the write-buffer.
>
> Your list of things to think about is good, but it should be pointed out
> that it applies _generally_ to all systems and all file systems.
>
> This is "Programming 101", and there was no excuse for people getting it
> wrong on JFFS2, either. It's not as if an fsync() was expensive in the
> cases where it did nothing.

I probably did not phrase things well enough and suggestions are
welcome.

But the idea of what I wanted to say is:
1. There is a lot of user-space which kind of works fine in JFFS2
2. But the user-space is buggy, and it looses/corrupts files in case of
UBIFS.
3. I try to explain why this happens, and why people should change their
user-space which sort of worked fine on JFFS2.

This is the reason why I brought up JFFS2 to the discussion and why I
called it synchronous. I did not intend to encourage people not to use
fsync() in case of JFFS2.