* Re: jffs2_do_reserve_space
@ 2002-07-25 18:47 Mike Schumi
2002-07-25 20:50 ` jffs2_do_reserve_space David Woodhouse
0 siblings, 1 reply; 7+ messages in thread
From: Mike Schumi @ 2002-07-25 18:47 UTC (permalink / raw)
To: dwmw2; +Cc: Mike Schumi, linux-mtd
David,
The Flash starts at 0x0 phys and has a firmware bootloader pre-configured in (has its own header too).
Then the Flash Loader I'm using adds a 0x40 header to the beginning of every binary image loaded to flash. It adds 0x40 to the Linux Loader (blob), Kernel, and jffs2.
I got confused by your emails!?! is this causing the problem we are seeing or its only causing the printks and sanity checks?!
If its only causing the sanity checks to appear, its fine for now (I'll fix the loader later on). But if its the cause of the kernel panic let me know.
When I add your patch (stable) I get:
Further such events for this erase block will not be printed
Node at 0x003dfd54 with
length 0x000002e6 would run over the end of the erase block
Perhaps the file system
was created with the wrong erase size?<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 notdjffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x003e0004: 0xe200 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x003e0008: 0x109a instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x003e000c: 0x2008 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x003e0010: 0x3da4 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x003e0014: 0x900e instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x003e0018: 0x35d2 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x003e001c: 0xa404 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x003e0020: 0x04f4 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x003e0024: 0x4801 instead
Further such events for this erase block will not be printed
Node at 0x003ffc80 with
length 0x000003bc would run over the end of the erase block
Perhaps the file system
was created with the wrong erase size?<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 notdjffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00400004: 0x2c17 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00400008: 0x684f instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0040000c: 0x0804 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00400010: 0x5f3c instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00400014: 0x614c instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00400018: 0x0984 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0040001c: 0xe791 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00400020: 0xb477 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00400024: 0xb7f5 instead
Further such events for this erase block will not be printed
VFS: Mounted root (jffs2 filesystem).
Freeing init memory: 72K
Kernel panic: Attempted to kill init!
Another question? why does the jffs do a sanity check on all flash when I'm only loading /dev/mtdblock2? Is there a way to make it not do so and only do so on the jffs2 image which I can download later without a 0x40 header?
----- Original Message -----
From: David Woodhouse <dwmw2@infradead.org>
Date: Thu, 25 Jul 2002 18:16:50 +0100
To:
Subject: Re: jffs2_do_reserve_space
>
> dwmw2@infradead.org said:
> > Can you try this?
>
> Or this version if you're using the stable branch...
>
> As I said in private mail, I suspect you've written your jffs2 image to the
> flash 0x40 bytes out of place, and the printk in this sanity check isn't
> actually correct for you, although it will be for most people who trigger
> it.
>
> Index: scan.c
> ===================================================================
> RCS file: /home/cvs/mtd/fs/jffs2/scan.c,v
> retrieving revision 1.51.2.2
> diff -u -p -r1.51.2.2 scan.c
> --- scan.c 23 Feb 2002 13:34:31 -0000 1.51.2.2
> +++ scan.c 25 Jul 2002 17:15:16 -0000
> @@ -261,6 +261,16 @@ static int jffs2_scan_eraseblock (struct
> continue;
> }
>
> + if (ofs + node.totlen > jeb->offset + c->sector_size) {
> + /* Eep. Node goes over the end of the erase block. */
> + printk(KERN_WARNING "Node at 0x%08x with length 0x%08x would run over the end of the erase block\n",
> + ofs, node.totlen);
> + printk(KERN_WARNING "Perhaps the file system was created with the wrong erase size?");
> + DIRTY_SPACE(4);
> + ofs += 4;
> + continue;
> + }
> +
> switch(node.nodetype | JFFS2_NODE_ACCURATE) {
> case JFFS2_NODETYPE_INODE:
> err = jffs2_scan_inode_node(c, jeb, &ofs);
>
>
> --
> dwmw2
>
>
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
>
--
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup
Get 4 DVDs for $.49 cents! plus shipping & processing. Click to join.
http://oas-central.realmedia.com/RealMedia/ads/click_lx.ads/mail.com/columbiahouse/1112745096/x09/ExactAdv/ColumbiaHouse_IO473_7.19_8.19/blank.gif/636632633232383133383736634333430
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: jffs2_do_reserve_space
2002-07-25 18:47 jffs2_do_reserve_space Mike Schumi
@ 2002-07-25 20:50 ` David Woodhouse
0 siblings, 0 replies; 7+ messages in thread
From: David Woodhouse @ 2002-07-25 20:50 UTC (permalink / raw)
To: Mike Schumi; +Cc: linux-mtd
schumi@techie.com said:
> Then the Flash Loader I'm using adds a 0x40 header to the beginning of
> every binary image loaded to flash. It adds 0x40 to the Linux Loader
> (blob), Kernel, and jffs2.
> I got confused by your emails!?! is this causing the problem we are
> seeing or its only causing the printks and sanity checks?!
> If its only causing the sanity checks to appear, its fine for now
> (I'll fix the loader later on). But if its the cause of the kernel
> panic let me know.
It was causing the panic. Now that I've added the sanity check in the patch
I sent you, it's causing that instead of a panic, and also it's causing the
corruption which prevents your init from starting.
--
dwmw2
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: jffs2_do_reserve_space
@ 2002-07-25 14:18 Mike Schumi
2002-07-25 17:04 ` jffs2_do_reserve_space David Woodhouse
0 siblings, 1 reply; 7+ messages in thread
From: Mike Schumi @ 2002-07-25 14:18 UTC (permalink / raw)
To: dwmw2, Mike Schumi; +Cc: linux-mtd
David,
(not ftp avail, sorry) I'll email you the dump for the 2 consecutive boots (If anyone else wants them let me know). Everytime I run the cardmgr and plug in the card, the next boot crashes on a write. And every boot after that too. I can bypass this problem by making /var a ramfs mount. (because cardmgr is writing to /var something). So it looks like write to a jffs2 /var is whats causing the problem, because when /var is mounted a ramfs and jffs2 is readonly, all is well. But solving this problem would be nice:)
Your help is appreciated...
Sequence on commands I ran:
<boot>
cat /proc/kmsg
echo 9 > /proc/sys/kernel/printk
df
cardmgr
<Plugged in the ATA CF card >
df
<Reboot>
cat /proc/kmsg
echo 9 > /proc/sys/kernel/printk
df
ls > text (<- crash)
----- Original Message -----
From: David Woodhouse <dwmw2@infradead.org>
Date: Thu, 25 Jul 2002 07:40:39 +0100
To: "Mike Schumi" <schumi@techie.com>
Subject: Re: jffs2_do_reserve_space
>
> schumi@techie.com said:
> > I've looked for a solution to this problem, but haven't seen it
> > posted anywhere, although some ppl have had it before.
>
> Please could you provide a complete debug log, from mount onwards. I need to
> see how the data structure got into that state. It'll be large -- maybe
> bzip2 it and tick it up for FTP somewhere?
>
> Also do 'df' as soon as it's happened.
>
>
> --
> dwmw2
>
>
>
--
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup
Get 4 DVDs for $.49 cents! plus shipping & processing. Click to join.
http://oas-central.realmedia.com/RealMedia/ads/click_lx.ads/mail.com/columbiahouse/1112745096/x09/ExactAdv/ColumbiaHouse_IO473_7.19_8.19/blank.gif/636632633232383133383736634333430
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: jffs2_do_reserve_space
2002-07-25 14:18 jffs2_do_reserve_space Mike Schumi
@ 2002-07-25 17:04 ` David Woodhouse
2002-07-25 17:16 ` jffs2_do_reserve_space David Woodhouse
0 siblings, 1 reply; 7+ messages in thread
From: David Woodhouse @ 2002-07-25 17:04 UTC (permalink / raw)
To: Mike Schumi; +Cc: linux-mtd
Can you try this?
Index: fs/jffs2/scan.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/scan.c,v
retrieving revision 1.78
diff -u -p -r1.78 scan.c
--- fs/jffs2/scan.c 2 Jul 2002 22:48:24 -0000 1.78
+++ fs/jffs2/scan.c 25 Jul 2002 17:04:28 -0000
@@ -322,6 +322,16 @@ static int jffs2_scan_eraseblock (struct
continue;
}
+ if (ofs + node.totlen > jeb->offset + c->sector_size) {
+ /* Eep. Node goes over the end of the erase block. */
+ printk(KERN_WARNING "Node at 0x%08x with length 0x%08x would run over the end of the erase block\n",
+ ofs, node.totlen);
+ printk(KERN_WARNING "Perhaps the file system was created with the wrong erase size?");
+ DIRTY_SPACE(4);
+ ofs += 4;
+ continue;
+ }
+
if (!(node.nodetype & JFFS2_NODE_ACCURATE)) {
/* Wheee. This is an obsoleted node */
D2(printk(KERN_DEBUG "Node at 0x%08x is obsolete. Skipping\n", ofs));
--
dwmw2
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: jffs2_do_reserve_space
2002-07-25 17:04 ` jffs2_do_reserve_space David Woodhouse
@ 2002-07-25 17:16 ` David Woodhouse
0 siblings, 0 replies; 7+ messages in thread
From: David Woodhouse @ 2002-07-25 17:16 UTC (permalink / raw)
Cc: Mike Schumi, linux-mtd
dwmw2@infradead.org said:
> Can you try this?
Or this version if you're using the stable branch...
As I said in private mail, I suspect you've written your jffs2 image to the
flash 0x40 bytes out of place, and the printk in this sanity check isn't
actually correct for you, although it will be for most people who trigger
it.
Index: scan.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/scan.c,v
retrieving revision 1.51.2.2
diff -u -p -r1.51.2.2 scan.c
--- scan.c 23 Feb 2002 13:34:31 -0000 1.51.2.2
+++ scan.c 25 Jul 2002 17:15:16 -0000
@@ -261,6 +261,16 @@ static int jffs2_scan_eraseblock (struct
continue;
}
+ if (ofs + node.totlen > jeb->offset + c->sector_size) {
+ /* Eep. Node goes over the end of the erase block. */
+ printk(KERN_WARNING "Node at 0x%08x with length 0x%08x would run over the end of the erase block\n",
+ ofs, node.totlen);
+ printk(KERN_WARNING "Perhaps the file system was created with the wrong erase size?");
+ DIRTY_SPACE(4);
+ ofs += 4;
+ continue;
+ }
+
switch(node.nodetype | JFFS2_NODE_ACCURATE) {
case JFFS2_NODETYPE_INODE:
err = jffs2_scan_inode_node(c, jeb, &ofs);
--
dwmw2
^ permalink raw reply [flat|nested] 7+ messages in thread
* jffs2_do_reserve_space
@ 2002-07-24 20:04 Mike Schumi
2002-07-25 6:40 ` jffs2_do_reserve_space David Woodhouse
0 siblings, 1 reply; 7+ messages in thread
From: Mike Schumi @ 2002-07-24 20:04 UTC (permalink / raw)
To: linux-mtd
Hi,
I've looked for a solution to this problem, but haven't seen it posted anywhere, although some ppl have had it before.
I'm running on a ARM board with 2 partitions, a Firmware Partition with the board Bootloader, Blob and Kernel 2.4.7, and another partition with the file system jffs2.
When I try to write to the jffs2 I get the below dump.
I've noticed that I this dump happens a boot after I run cardmgr to mount the /dev/hda for a ATA card.(its doesn't happen with te PCNET card)
i.e. I bootup, all is fine and do a lot of writes. Then I run cardmgr, plug in the card... mount /dev/hda on /mnt/ide ...copy files from the card, and to the card, then reboot and here is where the writes start going crazy. Any help would be appreciated ...
bash-2.05a# ls > test
jffs2_reserve_space(): Requested 0x44 bytes
jffs2_reserve_space(): alloc sem got
jeb=offset= 0x120000
jeb->offset =0x120000 c->sector_size =0x20000 jeb->free_size= 0xffffffc4
jffs2_do_reserve_space(): Giving 0xffffffc4 bytes at 0x14003c
ret0-jffs2_reserve_space: ret is 0
ARGH. About to write node to 0x0014003c on flash, but there's data already there:
0x0014003c: ff ff ff ff 85 19 02 e0 a5 04 00 00 9c 75 3d f1
argh. node added in wrong place
ARGH. About to write node to 0x00140080 on flash, but there's data already there:
0x00140080: 0e 4a 26 55 78 5e 5c 54 4d 68 5c 55 14 3e ef 67
argh. node added in wrong place
jffs2_reserve_space(): Requested 0xc4 bytes
jffs2_reserve_space(): alloc sem got
jeb=offset= 0x120000
jeb->offset =0x120000 c->sector_size =0x20000 jeb->free_size= 0xffffffc4
jffs2_do_reserve_space(): Giving 0xffffffc4 bytes at 0x14003c
ret0-jffs2_reserve_space: ret is 0
ARGH. About to write node to 0x0014003c on flash, but there's data already there:
0x0014003c: 85 19 02 e0 04 00 00 00 05 00 00 00 08 00 00 00
argh. node added in wrong place
Calculated used size 0001fffc != stored used size 0001ff58
kernel BUG at nodemgmt.c:334!
Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = c0ef8000
*pgd = c0f25801, *pmd = c0f25801, *pte = 00000000, *ppte = 00000000
Internal error: Oops: ffffffff
CPU: 0
pc : [<c001f330>] lr : [<c002600c>]
sp : c0efde68 ip : c0efde24 fp : c0efde78
r10: 00000000 r9 : 00000000 r8 : c0766c20
r7 : c0181cc0 r6 : c07dfec4 r5 : c0794190 r4 : 00000000
r3 : 00000000 r2 : 00000001 r1 : 00000001 r0 : 00000001
Flags: nZCv IRQs on FIQs on Mode SVC_32 Segment user
Control: C0EFB17F Table: C0EFB17F DAC: 00000015
Process ls (pid: 17, stackpage=c0efd000)
Stack:
c0efde40: c002600c c001f330
c0efde60: 60000013 ffffffff c0181cc8 c0efdebc c0efde7c c0085460 c001f2f8 c0efde88
c0efde80: c00856d0 c0084530 c078a420 00000000 00000006 c0019100 c078a420 00000000
c0efdea0: 00000006 c0019100 c0e2d0e0 c0e2d1ec c0efdf20 c0efdec0 c00839f8 c0085248
c0efdec0: 0014003c 00000000 00000065 00000000 00000065 00000000 c07dfec4 00000065
c0efdee0: 00000000 c01e4ff8 ffffffc4 0014003c 00000060 00000062 00000065 c01e4ff8
c0efdf00: 00000000 00000000 00000000 c01e5010 00000000 c0efdf80 c0efdf24 c003bb90
c0efdf20: c0083648 c0e2d13c 00000000 00000065 00000000 00000000 c0e2d184 c0e2d0e0
c0efdf40: c0017500 00000065 4001a000 c00174e0 00000000 0aefdf60 c00174e0 ffffffea
c0efdf60: 00000000 00000065 4001a000 00000004 40137e60 c0efdfac c0efdf84 c0047394
c0efdf80: c003b6b4 c001fe04 c0efdf94 00000065 40136e34 4001a000 c0efc000 c001a9a4
c0efdfa0: 00000000 c0efdfb0 c001a820 c00472c8 00000065 c0020bc8 00000001 4001a000
c0efdfc0: 00000065 40136e34 00000065 40136e34 4001a000 00000065 00000bf0 40135b00
c0efdfe0: 40137e60 bffffe14 400e1f00 bffffdf8 40092f68 400e1f04 60000010 00000001
Backtrace:
Function entered at [<c001f2ec>] from [<c0085460>]
r4 = C0181CC8
Function entered at [<c008523c>] from [<c00839f8>]
Function entered at [<c008363c>] from [<c003bb90>]
Function entered at [<c003b6a8>] from [<c0047394>]
Function entered at [<c00472bc>] from [<c001a820>]
r8 = C001A9A4 r7 = C0EFC000 r6 = 4001A000 r5 = 40136E34
r4 = 00000065
Code: eb001ab5 e3a03000 (e5833000) e91ba810 c013ef54
Kernel panic: Aiee, killing interrupt handler!
In interrupt handler - not syncing
--
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup
Get 4 DVDs for $.49 cents! plus shipping & processing. Click to join.
http://oas-central.realmedia.com/RealMedia/ads/click_lx.ads/mail.com/columbiahouse/1112745096/x09/ExactAdv/ColumbiaHouse_IO473_7.19_8.19/blank.gif/636632633232383133383736634333430
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: jffs2_do_reserve_space
2002-07-24 20:04 jffs2_do_reserve_space Mike Schumi
@ 2002-07-25 6:40 ` David Woodhouse
0 siblings, 0 replies; 7+ messages in thread
From: David Woodhouse @ 2002-07-25 6:40 UTC (permalink / raw)
To: Mike Schumi; +Cc: linux-mtd
schumi@techie.com said:
> I've looked for a solution to this problem, but haven't seen it
> posted anywhere, although some ppl have had it before.
Please could you provide a complete debug log, from mount onwards. I need to
see how the data structure got into that state. It'll be large -- maybe
bzip2 it and tick it up for FTP somewhere?
Also do 'df' as soon as it's happened.
--
dwmw2
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2002-07-25 20:50 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-25 18:47 jffs2_do_reserve_space Mike Schumi
2002-07-25 20:50 ` jffs2_do_reserve_space David Woodhouse
-- strict thread matches above, loose matches on Subject: below --
2002-07-25 14:18 jffs2_do_reserve_space Mike Schumi
2002-07-25 17:04 ` jffs2_do_reserve_space David Woodhouse
2002-07-25 17:16 ` jffs2_do_reserve_space David Woodhouse
2002-07-24 20:04 jffs2_do_reserve_space Mike Schumi
2002-07-25 6:40 ` jffs2_do_reserve_space David Woodhouse
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox