JFFS3 & performance

Jörn Engel joern at wohnheim.fh-wedel.de
Sat Dec 18 11:52:01 EST 2004


On Sat, 18 December 2004 17:26:59 +0100, Joakim Tjernlund wrote:
> > On Fri, 17 December 2004 12:19:55 +0100, Joakim Tjernlund wrote:
> >
> > It sure is hard to read.  Is there any version in C around?
> 
> Found this in RFC1017:

Thanks!

>        {
>            /* Compute Internet Checksum for "count" bytes
>             *         beginning at location "addr".
>             */
>        register long sum = 0;
> 
>         while( count > 1 )  {
>            /*  This is the inner loop */
>                sum += * (unsigned short) addr++;
>                count -= 2;
>        }
> 
>            /*  Add left-over byte, if any */
>        if( count > 0 )
>                sum += * (unsigned char *) addr;
> 
>            /*  Fold 32-bit sum to 16 bits */
>        while (sum>>16)
>            sum = (sum & 0xffff) + (sum >> 16);
> 
>        checksum = ~sum;
>    }

Even weaker than the weak checksums from rsync.  Hmm...

The algorithm should be faster than adler32, but also less secure.
Tough question now is how secure does the algorithm have to be?

o How often would we expect data corruption on the flash?
o How is it handled?  Mark erase as bad block and continue?
o How many data corruptions occur before flash is declared broken?

In the end, if data gets replaced with completely random garbage, is
it good enough to miss once such occurence out of 10?  Out of 1000?
1000000?

Jörn

-- 
Courage is not the absence of fear, but rather the judgement that
something else is more important than fear.
-- Ambrose Redmoon




More information about the linux-mtd mailing list