Re: JFFS3 & performance

Jörn Engel
2005-01-13T15:17:46Z

On Thu, 13 January 2005 15:05:16 +0000, Artem B. Bityuckiy wrote:
> On Thu, 13 Jan 2005, Artem B. Bityuckiy wrote:
>
> > See the benefits:
> > 1. We are able to use weaker then CRC32 checksums and still be good in
> > detecting wrong due to unclean reboot nodes.
> > 2. We have principal ability to distingush between nodes corrupted due to
> > flash problems and due to unclean reboots.
> > This is extreemly good do be able to distinguish. (JFFS2 has no such
> > ability).

Right, very nice attributes.

> > Thoughts?
> Hmm, only one small note, putting CRC to the end does not allow us to
> recognize unclean reboots and flash media corruptions :-) But we still may
> do this putting some majic bitmask to the end of nodes.

static uint32_t jffs3_checksum(...)
{
static uint32_t ret = do_jffs3_checksum(...);
if (ret == 0xffffffff)
return 0;
return ret;
}

When reading the node, simply compare the checksum to 0xffffffff. If
it matches, we know that
a) the checksum is wrong and
b) it was due to incomplete write, not flash corruption.

Adler32 has the nice property that 0xffffffff is an impossible
checksum by design already, so the above code wouldn't be necessary.

Jörn

--
...one more straw can't possibly matter...
-- Kirby Bakken