JFFS2 wbuf non-contiguous write bug

Jörn Engel joern at wohnheim.fh-wedel.de
Thu Jun 29 11:07:01 EDT 2006


On Thu, 29 June 2006 09:46:10 -0500, Josh Boyer wrote:
> On 6/29/06, Alexander Belyakov <abelyako at googlemail.com> wrote:
> >On 6/29/06, Jörn Engel <joern at wohnheim.fh-wedel.de> wrote:
> >
> >Anyway I was speaking _not_ about reverting part of your patch but
> >about getting back following code for Sibley, since it indeed shows if
> >we moved to a new eraseblock.
> >
> >                if (((c->wbuf_ofs % c->sector_size) == 0) && !c->wbuf_len) 
> >                {
> >                        c->wbuf_ofs = PAGE_DIV(to);
> >                        c->wbuf_len = PAGE_MOD(to);
> >                        memset(c->wbuf,0xff,c->wbuf_pagesize);
> >                }
> >
> >> You must be missing something, but I don't know what.  Maybe Josh has
> >> some insight into this problem - he did a thorough review and asked
> >> many probing questions about this particular part of the patch.
> >
> >It would be really nice, since current code seems to be broken somehow.
> 
> I remember going over this with Jörn a while back and being convinced
> NOR ECC didn't need that check any longer.  I don't recall looking if
> Sibley does though.  I'll try to look at it again, but obviously if it
> fixes a bug then it should probably go back in.  I don't think it can
> hurt anything at the moment.

Agreed.  If the second check had been in the git code already,
        if (jffs2_nor_ecc(c) || jffs2_nor_wbuf_flash(c)) {
I would have sent a different patch, simply combining the two
conditions into one.

Next question is: does the check against sibley/nor_ecc make sense?
Would the code hurt anyone if it was enabled for nand and dataflash as
well?

Jörn

-- 
Beware of bugs in the above code; I have only proved it correct, but
not tried it.
-- Donald Knuth




More information about the linux-mtd mailing list