Re: data loss on jffs2 filesystem on dataflash

Artem B. Bityutskiy
2005-09-20T15:12:13Z

Peter Menzebach wrote:
> Artem B. Bityutskiy wrote:
>> But In your logs, I saw that you have *write buffer* size = 8*1056!
>> Write buffer size is another thing. It is the minimal flash IO unit.
>> JFFS2 assumes that it cannot write 1 byte or 100 bytes, it assumes that
>> it can only write 'write buffer size' bytes. And the goal of the write
>> buffer is to accumulate many small JFFS2 writes in RAM, and when the
>> write buffer becomes full, it is flushed to flash.
>> So, in your case, make write buffer = Data Flash page size = 1056.
>>
> How can this reported from the flash device to the mtd layer and then to
> jffs2?
> In the code, I see at the moment only, that in the device driver
> mtd_info.erasesize is set, later on in jffs2 I see, that this has become
> the sector_size, which becomes then the wbuf_pagesize.
I see, in jffs2_dataflash_setup(): c->wbuf_pagesize = c->sector_size;
I don't know why Andrew Victor set wbuf size to Sector Size. May be
you'll ask him?

Ok, theoretically this should work as well. But having smaller wbuf size
is better.

> Is here mtd_info.ooblock to be set?
Yes, I in case of NAND we use this, I guess you may use it as well ...
May be it is time to introduce a 'writesize' field to mtd_info, instead
of 'oobblock' ... ?