Re: data loss on jffs2 filesystem on dataflash

Artem B. Bityutskiy
2005-09-21T15:59:58Z

Peter Menzebach wrote:
> Ok, Ok, now I am digging a bit....
> with some more printfs, I now looked a bit clearer, and have another
> question:
> when jffs2_flush_wbuf is called, how is this area now markes as written.
> Sometimes later jffs2_do_reserve_space is called an returns the same
> address, which was written to flash....
>
The space is accounted by corresponding fields in jffs2_eraseblock
structure: free_size, wasted_size, used_size.

Jffs2 always writes to c->sector_size - jeb->free_size.

The corresponding place in jffs2_flush_wbuf, where the parameters a
adjusted is wbuf.c:506.

But.. Argh! Look at line 488: if (pad && !jffs2_dataflash(c))

Why !jffs2_dataflash(c)??? I bet this is the bug.