jffs2: too few erase blocks

Jamie Lokier jamie at shareable.org
Sun Oct 28 14:02:23 EDT 2007


Duke wrote:
> Just to clarity myself a bit here. There is nothing stopping me from
> using the cp or mv (or any other file modification command for that
> matter) to update one directory but I would like to be able to verify
> the data is actually written and I thought perhaps mtd_debug or some
> other mtd tool might be able to verify this. Maybe it's not maybe it
> is, I would like to find out.

If you call "fsync()" or "fdatasync()" after writing the data to a
file, that is suppoe to ensure the data is written when the function
returns.

That's supposed to happen, but I don't know if JFFS2 actually does
that.

If you call fsync() on a directory handle, that traditionally ensures
the file names in that directory are written.  So to be sure of
creating a file and writing to it, you would create the file, write
it, fsync() it, then open the directory containing the file and
fsync() the directory.  For example, email delivery programs use that
strategy before reporting to a sender that the email is safely stored.

But again, I don't know if JFFS2 actually does provide those assurances.

-- Jamie



More information about the linux-mtd mailing list