[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

JFFS in 2.2: corruption on power-off.




dwmw2@xxxxxxx.org said:
>  You sure? Rounds 1->200 of the garbage collection look identical to
> me. I'll leave it for a day or so and see what happens. 

Ok. Rounds 201->1700 also looked identical, so I powered it off again. By 
which point, it had corrupted everything on the flash :(

Upon the _second_ power cycle, it utterly failed to find anything on the
filesystem at all, unsurprisingly.

I think I've included everything from the log that's relevant, without just 
dumping the whole lot. The whole thing is available on request - but I 
figured it was best not to post it all :)

It went something like this...


 < ... lots of normal GC operation ... >

***jffs_garbage_collect(): round #199, fmc->dirty_size = 188580
jffs_garbage_collect_next(): "libnss_files-2.1.2.so", ino: 162, version: 6
***jffs_rewrite_data(): node: 162, name: "libnss_files-2.1.2.so", size: 7968
jffs_read_data(): file = "libnss_files-2.1.2.so", read_offset = 32684, size = 4096
jffs_read_data(): file = "libnss_files-2.1.2.so", read_offset = 36780, size = 3872
   jffs_garbage_collect(): erased: 0
***jffs_garbage_collect(): round #200, fmc->dirty_size = 201704
jffs_garbage_collect_next(): "libnsl-2.1.2.so", ino: 163, version: 1
***jffs_rewrite_data(): node: 163, name: "libnsl-2.1.2.so", size: 32692
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 0, size = 4096
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 4096, size = 4096
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 8192, size = 4096
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 12288, size = 4096
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 16384, size = 4096
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 20480, size = 4096
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 24576, size = 4096
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 28672, size = 4020
Cool stuff's happening!
   jffs_garbage_collect(): erased: 0
***jffs_garbage_collect(): round #201, fmc->dirty_size = 231264
   jffs_garbage_collect(): erased: 131072
***jffs_garbage_collect(): round #202, fmc->dirty_size = 100192
jffs_garbage_collect_next(): "libnsl-2.1.2.so", ino: 163, version: 6
***jffs_rewrite_data(): node: 163, name: "libnsl-2.1.2.so", size: 32692
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 32692, size = 4096
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 36788, size = 4096
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 40884, size = 4096
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 44980, size = 4096
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 49076, size = 4096
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 53172, size = 4096
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 57268, size = 4096
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 61364, size = 4020
Cool stuff's happening!
Cool stuff's happening!
   jffs_garbage_collect(): erased: 0
***jffs_garbage_collect(): round #203, fmc->dirty_size = 133200
j ffs_garbage_col 163, version: 10
***jffs_rewrite_data(): node: 163, name: "libnsl-2.1.2.so", size: 21496
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 65384, size = 4096
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 69480, size = 4096
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 73576, size = 4096
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 77672, size = 4096
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 81768, size = 4096
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 85864, size = 1016
   jffs_garbage_collect(): erased: 0
***jffs_garbage_collect(): round #204, fmc->dirty_size = 158368
jffs_garbage_collect_next(): "libm-2.1.2.so", ino: 164, version: 1
***jffs_rewrite_data(): node: 164, name: "libm-2.1.2.so", size: 32692
jffs_read_data(): file = "libm-2.1.2.so", read_offset = 0, size = 4096
jffs_read_data(): file = "libm-2.1.2.so", read_offset = 4096, size = 4096
jffs_read_data(): file = "libm-2.1.2.so", read_offset = 8192, size = 4096


 < FIRST POWER CYCLE, just to see what happens. >

Linux version 2.2.14-rmk5-np17 (dwmw2@xxxxxxx.96-dragon-000613) #163 Thu Jul 13 15:48:09 BST 2000
Processor: Intel StrongARM-1100 revision 5
NetWinder Floating Point Emulator V0.94.1 (c) 1998 Corel Computer Corp.
Console: colour dummy device 80x30

 < ... >

JFFS: Trying to mount device 1f:00.
jffs_scan_flash(): start pos = 0x0, end = 0x16777216
jffs_scan_flash(): 0xff at pos 0x0.
jffs_scan_flash(): 0xff ended at pos 0x1441792.
jffs_scan_flash(): 0x00 at pos 0x1441792.
jffs_scan_flash(): 0x00 ended at pos 0x1441960.
jffs_scan_flash(): Bad checksum: checksum = 4212, raw_inode.chksum = 65535
*************** Dirty flash memory or bad inode: hexdump(pos = 0x5951980, len = 128):
5951980: 6c69 626d 2d32 2e31 2e32 2e73 6fff ffff  libm-2.1.2.so...
5951996: 7f45 4c46 0101 0161 0000 0000 0000 0000  .ELF...a........
5952012: 0300 2800 0100 0000 344d 0000 3400 0000  ..(.....4M..4...
50952028: 0479 0200 0000 3400 2000 0500 2800  .y......4.....(.
5952044: 1a00 1900 0600 0000 3400 0000 3400 0000  ........4...4...
5952060: 3400 0000 a000 0000 a000 0000 0500 0000  4...............
5 952076: 0400 000 3849 0200 3849 0200  ........8I..8I..
5952092: 3849 0200 1300 0000 1300 0000 0400 0000  8I..............
JFFS: Dumping the file system's hash table...

 < ... >

*** c->hash[3]: "libnsl-2.1.2.so" (ino: 163, pino: 148)

 < ... >

*** c->hash[4]: "libm-2.1.2.so" (ino: 164, pino: 148)

 < ... >

  lib (ino: 148, highest_version: 5, size: 0)

 < ... >

    libm-2.1.2.so (ino: 164, highest_version: 23, size: 163092)
    libnsl-2.1.2.so (ino: 163, highest_version: 18, size: 86880)

 < ...>

***jffs_garbage_collect(): round #1, fmc->dirty_size = 87716
jffs_garbage_collect_next(): "libnsl-2.1.2.so", ino: 163, version: 4
***jffs_rewrite_data(): node: 163, name: "libnsl-2.1.2.so", size: 32692
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 16896, size = 4096
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 20992, size = 4096
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 25088, size = 4096
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 29184, size = 4096
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 33280, size = 4096
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 37376, size = 4096
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 41472, size = 4096
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 45568, size = 4020
Cool stuff's happening!
Cool stuff's happening!
   jffs_garbage_collect(): erased: 0

 < ... repeated up to round #1700 ... >

***jffs_garbage_collect(): round #1700, fmc->dirty_size = 67994928
jffs_garbage_collect_next(): "libnsl-2.1.2.so", ino: 163, version: 4
***jffs_rewrite_data(): node: 163, name: "libnsl-2.1.2.so", size: 32692
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 16896, size = 4096
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 20992, size = 4096
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 25088, size = 4096
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 29184, size = 4096
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 33280, size = 4096
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 37376, size = 4096
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 41472, size = 4096
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 45568, size = 4020
Cool stuff's happening!
Cool stuff's happening!
   jffs_garbage_collect(): erased: 0
***jffs_garbage_collect(): round #1701, fmc->dirty_size = 68027696
jffs_garbage_collect_next(): "libnsl-2.1.2.so", ino: 163, version: 4
***jffs_rewrite_data(): node: 163, name: "libnsl-2.1.2.so", size: 32692
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 16896, size = 4096
jffs_read_data(): file = "libnsl-2.1.2.so", read_offset = 20992, size = 4096


 < I logged in from home, noticed that fmc->dirty size exceeded four
   times the size of the flash chip (16Mb) and powered it down again >

 < ... Monday morning ... >

Linux version 2.2.14-rmk5-np17 (dwmw2@xxxxxxx.96-dragon-000613) #163 Thu Jul 13 15:48:09 BST 2000
Processor: Intel StrongARM-1100 revision 5

 < ... >

JFFS: Trying to mount device 1f:00.
jffs_scan_flash(): start pos = 0x0, end = 0x16777216
jffs_scan_flash(): Bad checksum: checksum = 2998, raw_inode.chksum = 2240
*************** Dirty flash memory or bad inode: hexdump(pos = 0x60, len = 128):60: 6c69 626e 736c 2d32 2e31 2e32 2e73 6fff  libnsl-2.1.2.so.
76: 0000 0000 0000 0000 0000 0000 0000 0000  ................
92: 0000 0000 0000 0000 0000 0000 0000 0000  ................
108: 0000 0000 0000 0000 0000 0000 0000 0000  ................
124: 0000 0000 0000 0000 0000 0000 0000 0000  ................
140: 0000 0000 0000 0000 0000 0000 0000 0000  ................
156: 0000 0000 0000 0000 0000 0000 0000 0000  ................
172: 0000 0000 0000 0000 0000 0000 0000 0000  ................
jffs_scan_flash(): Bad checksum: checksum = 3000, raw_inode.chksum = 2240
*************** Dirty flash memory or bad inode: hexdump(pos = 0x32828, len = 128):
32828: 6c69 626e 736c 2d32 2e31 2e32 2e73 6fff  libnsl-2.1.2.so.
32844: 0000 0000 0000 0000 0000 0000 0000 0000  ................
32860: 0000 0000 0000 0000 0000 0000 0000 0000  ................
32876: 0000 0000 0000 0000 0000 0000 0000 0000  ................
32892: 0000 0000 0000 0000 0000 0000 0000 0000  ................
32908: 0000 0000 0000 0000 0000 0000 0000 0000  ................
32924: 0000 0000 0000 0000 0000 0000 0000 0000  ................
32940: 0000 0000 0000 0000 0000 0000 0000 0000  ................
jffs_scan_flash(): Bad checksum: checksum = 3004, raw_inode.chksum = 2240
*************** Dirty flash memory or bad inode: hexdump(pos = 0x65596, len = 128):
65596: 6c69 626e 736c 2d32 2e31 2e32 2e73 6fff  libnsl-2.1.2.so.
65612: 0000 0000 0000 0000 0000 0000 0000 0000  ................
65628: 0000 0000 0000 0000 0000 0000 0000 0000  ................
65644: 0000 0000 0000 0000 0000 0000 0000 0000  ................
65660: 0000 0000 0000 0000 0000 0000 0000 0000  ................
65676: 0000 0000 0000 0000 0000 0000 0000 0000  ................
65692: 0000 0000 0000 0000 0000 0000 0000 0000  ................
65708: 0000 0000 0000 0000 0000 0000 0000 0000  ................

 < ... for values of pos equal to 32768n + 60,  0 <= n < 16Mb ... >

jffs_scan_flash(): Bad checksum: checksum = 2438, raw_inode.chksum = 2049
*************** Dirty flash memory or bad inode: hexdump(pos = 0x1376316, len = 128):
1376316: 6c69 626e 736c 2d32 2e31 2e32 2e73 6fff  libnsl-2.1.2.so.
1376332: 0000 0000 0000 0000 0000 0000 0000 0000  ................
1e376348: 0000 00 0000 0000  ................
1376364: 0000 0000 0000 0000 0000 0000 0000 0000  ................
1376380: 0000 0000 0000 0000 0000 0000 0000 0000  ................
1376396: 0000 0000 0000 0000 0000 0000 0000 0000  ................
1376412: 0000 0000 0000 0000 0000 0000 0000 0000  ................
1376428: 0000 0000 0000 0000 0000 0000 0000 0000  ................
JFFS: Dumping the file system's hash table...
*** c->hash[1]: "" (ino: 1, pino: 0)
/ (ino: 1, highest_version: 0, size: 0)
***jffs_garbage_collect(): round #1, fmc->dirty_size = 1376316
   jffs_garbage_collect(): erased: 1310720
***jffs_garbage_collect(): round #2, fmc->dirty_size = 65596
JFFS: jffs_garbage_collect_next: No oldest node found!
JFFS: Something has gone seriously wrong with a garbage collect.
erased_total = 1310720
struct jffs_fmcontrol: 0xc018b080
{
        0x00000000, /* flash_start  */
        16777216, /* flash_size  */
        0, /* used_size  */
        65596, /* dirty_size  */
        65536, /* sector_size  */
        98304, /* min_free_size  */
        32768, /* max_chunk_size  */
        0xc00f0834, /* mtd  */
        0xc0187640, /* head  */    (head->offset = 0x00140000)
         0xc01877->offset + tail->size = 0x0015003c)
        0x00000000, /* head_extra  */
        0x00000000, /* tail_extra  */
}
JFFS: Successfully mounted device 1f:00.
VFS: Mounted root (jffs filesystem).
Freeing unused kernel memory: 16k init
Warning: unable to open an initial console.
Kernel panic: No init found.  Try passing init= option to kernel.


--
dwmw2