data loss on jffs2 filesystem on dataflash

Artem B. Bityutskiy dedekind at infradead.org
Tue Sep 20 10:18:19 EDT 2005


On Tue, 2005-09-20 at 15:38 +0200, Peter Menzebach wrote:
> I do need some wear leveling (and a filesystem which supports block 
> sizes of 1056 bytes ;) )
Ok.

> The main memory array is the flash itself with pages of 1056 bytes
Ok, just strange name. On the picture they call it "Flash memory array".

> my reasons for setting erase block size to 8(16)*1056:
> 1. my lazyness -> I have to patch the mkfs.jff2 every time, since it 
> makes a guess, that -e 1056 is not a very good idea (at lest the 
> versions some times ago)
-e specifies the *erasesize*. In your case, make it = DataFlash block
size = 8*1056. So, all is OK. Although you may make it 1056 (DataFlash
allows this?), it is bad idea.

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.


> 2. It seemed to me, that jffs2 boots faster, if the number of blocks is 
> smaller.
I guess we have got confused with terminology. Please, let use this:

eraseblock - the minimal erase unit
IO block - the minimal IO unit = write buffer size

eraseblocks are usually larger then IO blocks.

The larger is the IO block, the more data you loose due to unclean
reboots in case of JFFS2. So, don't make it larger then 1056.

-- 
Best Regards,
Artem B. Bityuckiy,
St.-Petersburg, Russia.





More information about the linux-mtd mailing list