[PATCH] [JFFS2] Non-contiguous write bug fix (Sibley)

Alexander Belyakov abelyako at googlemail.com
Wed May 2 10:53:21 EDT 2007


On 5/2/07, David Woodhouse <dwmw2 at infradead.org> wrote:
>
> Can you add something like a WARN_ON(!(c->wbuf_ofs % c->sector_size))
> whereever we set c->wbuf_ofs, and see where it's happening?
>

Done. It seems __jffs2_flush_wbuf() sets 'wbuf_ofs' to the first page in block.

BUG: at fs/jffs2/wbuf.c:639 __jffs2_flush_wbuf()
jffs2_flash_writev(): Non-contiguous write to 008c0400
kernel BUG at fs/jffs2/wbuf.c:790!

'wbuf_ofs' is set to the first page in block quite often in
__jffs2_flush_wbuf(), but this doesn't always lead to
jffs2_flash_writev() failure. If 'to' is pointing to the different
block, condition (SECTOR_ADDR(to) != SECTOR_ADDR(wbuf_ofs)) works fine
and we don't hit BUG() despite 'wbuf_ofs' points to the first page in
block.

Probably we should put additional 'wbuf_ofs' adjustment to the
__jffs2_flush_wbuf() checking if we're moving to the new erseblock.

Thanks,
Alexander




More information about the linux-mtd mailing list