[PATCH]fs/jffs2/wbuf.c: add compatibility support for OOB data block
Artem B. Bityuckiy
dedekind at yandex.ru
Mon Aug 15 07:07:31 EDT 2005
Ok, to keep you busy with some technical stuff also, here is a remark.
>+ if (je32_to_cpu(sm->magic) == JFFS2_SUM_MAGIC ) {
>+
>+ if(je32_to_cpu(sm->erase_size) == c->sector_size) {
>+ err =
>jffs2_sum_scan_sumnode(c,jeb,je32_to_cpu(sm->offset),&pseudo_random);
>+
>+ if (err) {
>+ kfree(sm);
>+ return err;
>+ }
>+ }
>+ printk(KERN_WARNING "FS erase_block_size != JFFS2 erase_block_size
=> skipping summary information\n");
>+ }
if(je32_to_cpu(sm->erase_size) == c->sector_size) { ...
AFAIU, you're protecting against the situation when the size of the
JFFS2 virtual eraseblock is changed.
But why is the eraseblock size may change? If it becomes less, this is a
problem since some nodes that cross the boundary will be ignored. If the
size of the JFFS2 virtual eraseblock becomes larger, it is also a
problem - due to present bad blocks, some eraseblocks with valid data
will be ignored (remember, if there is a bad eraseblock in the JFFS2
virtual eraseblock, the whole virtual eraseblock is regarded as bad).
Thus, please, don't solve this problem this way. You're trying to solve
it privately for your summaries, while you have to solve it for *JFFS2
in general* (if it exists at all). I suppose it exists in your case
since you add one more field to struct eraseblock...
--
Best Regards,
Artem B. Bityuckiy,
St.-Petersburg, Russia.
More information about the linux-mtd
mailing list