Re: data loss on jffs2 filesystem on dataflash

Peter Menzebach
2005-09-21T13:57:27Z

Artem B. Bityuckiy wrote:
> Peter Menzebach wrote:
>
>> - if (!jffs2_can_mark_obsolete(c) && c->nextblock &&
>> (c->nextblock->free_size & (c->wbuf_pagesize-1))) {
>> + if (!jffs2_can_mark_obsolete(c) && c->nextblock &&
>> (c->nextblock->free_size % c->wbuf_pagesize)) {
>
> [snip]
>
>> - uint32_t skip = c->nextblock->free_size & (c->wbuf_pagesize-1);
>> + uint32_t skip = c->nextblock->free_size % c->wbuf_pagesize;
>
> [snip]
>
>> -#ifdef CONFIG_JFFS2_FS_WRITEBUFFER
>> #define PAGE_DIV(x) ( ((unsigned long)(x) / (unsigned
>> long)(c->wbuf_pagesize)) * (unsigned long)(c->wbuf_pagesize) )
>> #define PAGE_MOD(x) ( (unsigned long)(x) % (unsigned
>> long)(c->wbuf_pagesize) )
>> -#else
>> -#define PAGE_DIV(x) ( (x) & (~(c->wbuf_pagesize - 1)) )
>> -#define PAGE_MOD(x) ( (x) & (c->wbuf_pagesize - 1) )
>> -#endif
>
> Looks sane.
>
Do you put this into cvs or shall I submit it later again?

Best regards
Peter

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