[PATCH]fs/jffs2/wbuf.c: add compatibility support for OOB data block
Artem B. Bityuckiy
dedekind at yandex.ru
Mon Aug 15 08:35:07 EDT 2005
Ferenc Havasi wrote:
> No. The task of this condition is to make sure that the summary was
> generated correctly. If the summary is generated by the filesystem, it
> will be always good, but you are also able to generate summary with the
> userspace tool 'sumtool'. If we do not recognise this mistake that can
> cause big problems and make the user confused.
>
Err, do you mean that sumtool may generate summary with wrong erase_size?
Well, but my assumption is also valid. Glance at fs.c:466
c->sector_size = c->mtd->erasesize;
blocks = c->flash_size / c->sector_size;
if (!(c->mtd->flags & MTD_NO_VIRTBLOCKS)) {
while ((blocks * sizeof (struct jffs2_eraseblock)) > (128 * 1024)) {
blocks >>= 1;
c->sector_size <<= 1;
}
}
Here the size of eraseblock depends on sizeof(struct jffs2_eraseblock).
You increase the size of 'struct jffs2_eraseblock'. So, you may have a
situation when one mounts an *old* image with *new* JFFS2 with *summary
enabled*, and JFFS2 uses *larger* virtual eraseblock size, because
blocks * sizeof (struct jffs2_eraseblock)) > (128 * 1024)
condition is changed.
How is this situation handled?
--
Best Regards,
Artem B. Bityuckiy,
St.-Petersburg, Russia.
More information about the linux-mtd
mailing list