Re: data loss on jffs2 filesystem on dataflash

Andrew Victor
2005-09-21T07:24:38Z

hi Artem,

> > To reduce the number of erase blocks, JFFS2 may also concatenate a
> > number of erase-blocks in a 'virtual block'. That is what sector_size
> > and wbuf_pagesize might get set to.
> Yes, right. Albeit this is fixed, this doesn't matter.
>
> The question is *why you set wbuf size = eraseblock size?

I don't. I set the wbuf_pagesize to the sector_size.
(Which at that time was 1 or more eraseblocks. And I think sector_size
is/was the smallest unit of flash that JFFS2 would ever erase/write).

> In case of
> DataFlash, I assume, wbuf_size = DataFlash page size (the minimal
> writing unit). Eraseblock size must be = DataFlash block size.

Maybe there is some confusion here. Dataflash has both 'pages' and
'blocks'. With a 'page' being the smallest unit that can be
erased/written.

The MTD-device's erasesize is therefore set to the smallest unit - the
Dataflash page size (528 or 1056, depending on device)

> Yes, it is theoretically correct to set write buffer size = eraseblock
> size, but this is *really* bad. This is wasteful (imagine, any sync will
> will add lots of padding and waste the whole eraseblock).

Dataflash does not use Padding nodes.

> And, the size wbuf has nothing to do with "concatenate number of
> eraseblocks", whare is the relation?

Maybe it would be more optimal to set the wbuf_size to eraseblocksize?
I don't know.

I do know that JFFS2-on-Dataflash was working fine when I committed the
changes in February.

Regards,
Andrew Victor