Problem: 51MB partition max size on jffs2
Thomas Gleixner
tglx at linutronix.de
Wed Dec 4 18:20:44 EST 2002
On Thursday 05 December 2002 00:08, Ken Offer wrote:
> On Wednesday, December 4, 2002, at 04:02 PM, Thomas Gleixner wrote:
> > On Wednesday 04 December 2002 23:00, Ken Offer wrote:
> >> On Wednesday, December 4, 2002, at 11:47 AM, Thomas Gleixner wrote:
> >>> Latest CVS code ?
> >>
> >> I tried it with an older version (circa 20020819) and the latest code
> >> (20021202). Same result. I am going to try the change Dave Ellis
> >> <DGE at sixnetio.com> suggested.
> >
> > Strange. Could you please tell me, what output the latest CVS code
> > produces
>
> Well, I was getting a mount failure. There wasn't much info other than
> that. If you look in the latest (20021202) jffs2 build.c file, you can
> see if the kmalloc of c->blocks fails in jffs2_do_mount_fs, no debug
> message is printed. Only a non-mem error is returned. That is
> consistent with what I was seeing, even with the highest verbosity
> debugging on.
>
> I made the change to use vmalloc/vfree for c->blocks and that seemd to
> fix the problem. kmalloc is indeed limited to 128KB. Of course, I
> made the change to the 20020819 code. I'll try the vmalloc change with
> the latest CVS code as well and see how that holds up.
Please wait.
Could you please verify, if the code in fs. c does, what it should do ?
int jffs2_do_fill_super(struct super_block *sb, void *data, int silent)
{
SNIP
c->flash_size = c->mtd->size;
/*
* Check, if we have to concatenate physical blocks to larger virtual blocks
* to reduce the memorysize for c->blocks. (kmalloc allows max. 128K
allocation)
*/
blocks = c->flash_size / c->mtd->erasesize;
while ((blocks * sizeof (struct jffs2_eraseblock)) > (128 * 1024))
blocks >>= 1;
c->sector_size = c->flash_size / blocks;
if (c->sector_size != c->mtd->erasesize)
printk(KERN_INFO "jffs2: Erase block size too small (%dKiB). Using virtual
blocks size (%dKiB) instead\n",
c->mtd->erasesize / 1024, c->sector_size / 1024);
This is processed before calling jffs2_do_mount_fs. There is calculated:
c->nr_blocks = c->flash_size / c->sector_size;
c->blocks = kmalloc(sizeof(struct jffs2_eraseblock) * c->nr_blocks,
GFP_KERNEL);
if (!c->blocks)
return -ENOMEM;
So it should rely on the previous adjusted sectorsize.
--
Thomas
____________________________________________________
linutronix - competence in embedded & realtime linux
http://www.linutronix.de
mail: tglx at linutronix.de
More information about the linux-mtd
mailing list