data loss on jffs2 filesystem on dataflash

Peter Menzebach pm-mtd at mw-itcon.de
Tue Sep 20 11:45:26 EDT 2005


Artem B. Bityutskiy wrote:
> 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.

Ok, wirh the answer from Andrew, the conclusion is for me at the moment:

At the moment the mtd layer only reports one usable "tile" value to 
jffs2, which is the erasesize.

So the erase_size is the only sensful value, which can be used as 
sector_size and wbuf_pagesize.

I can fix the mkfs.jffs2 (if needed), that it can generate correct 
images for a erase_size of 1056.

Open questions:

I think, the original problem with the lost files is not solved, if I 
reduce the erase size?

Make sector_size=erase_size=wbuf_size=1056 sense?

Best regards
Peter






-- 
Peter Menzebach
Menzebach und Wolff IT-Consulting GbR
Phone +49 751 355 387 1




More information about the linux-mtd mailing list