Corrupted UBIFS, bad CRC

Karsten Jeppesen arm9263 at yahoo.com
Wed Nov 23 07:49:49 EST 2011


Hi Artem,

First: I love the UBIFS. It performs really really well.

Amongst many well functioning targets (ARM 9263 based) this sucker had the nerves to act up:



Uncompressing Linux........... done, booting the kernel.
[    1.570000] UBIFS error (pid 1): ubifs_check_node: bad CRC: calculated 0x7d62d42c, read 0x1173c109
[    1.580000] UBIFS error (pid 1): ubifs_check_node: bad node at LEB 84:50696
[    1.580000] UBIFS error (pid 1): ubifs_read_node: expected node type 9
[    1.590000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)



I am running a kernel 2.6.32.8 with most patches applied. Especially the recovery.c patch and the mtd (8 byte write buffer patch) applied. The target that showed this error does not have these patches applied.

Even so... I copied the FLASH content to a target with these patches and tried again in order to see if these patches would allow the kernel to rectify the problem. No cigar.
Of course I ran with debug enabled so here are the output (but even better I hope - here is the flash image for download: http://download.gnist.skov.com/corrupt_ubifs.img )

----
[    1.570000] atmel_usart.3: ttyS3 at MMIO 0xfff94000 (irq = 9) is a ATMEL_SERIAL
[    1.630000] brd: module loaded
[    1.660000] loop: module loaded
[    1.670000] physmap platform flash device: 04000000 at 10000000
[    1.680000] Number of erase regions: 1
[    1.680000] Warning:  Overriding MaxBufWriteSize from 2^6 to 2^3
[    1.690000] Primary Vendor Command Set: 0002 (AMD/Fujitsu Standard)
[    1.690000] Primary Algorithm Table at 0040
[    1.700000] Alternative Vendor Command Set: 0000 (None)
[    1.700000] No Alternate Algorithm Table
[    1.710000] Vcc Minimum:  2.7 V
[    1.710000] Vcc Maximum:  3.6 V
[    1.710000] No Vpp line
[    1.720000] Typical byte/word write timeout: 64 µs
[    1.720000] Maximum byte/word write timeout: 512 µs
[    1.730000] Typical full buffer write timeout: 64 µs
[    1.730000] Maximum full buffer write timeout: 2048 µs
[    1.740000] Typical block erase timeout: 512 ms
[    1.740000] Maximum block erase timeout: 4096 ms
[    1.750000] Typical chip erase timeout: 131072 ms
[    1.750000] Maximum chip erase timeout: 524288 ms
[    1.760000] Device size: 0x2000000 bytes (32 MiB)
[    1.760000] Flash Device Interface description: 0x0002
[    1.770000]   - supports x8 and x16 via BYTE# with asynchronous interface
[    1.770000] Max. bytes in buffer write: 0x8
[    1.780000] Number of Erase Block Regions: 1
[    1.780000]   Erase Region #0: BlockSize 0x20000 bytes, 256 blocks
[    1.790000] physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
[    1.790000]  Amd/Fujitsu Extended Query Table at 0x0040
[    1.800000] physmap-flash.0: CFI does not contain boot bank location. Assuming top.
[    1.810000] number of CFI chips: 1
[    1.810000] cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
[    1.820000] 5 cmdlinepart partitions found on MTD device physmap-flash.0

----
# skovsetup mountflash
[  165.940000] UBI: attaching mtd4 to ubi0
[  165.950000] UBI: physical eraseblock size:   131072 bytes (128 KiB)
[  165.950000] UBI: logical eraseblock size:    130944 bytes
[  165.960000] UBI: smallest flash I/O unit:    1
[  165.960000] UBI: VID header offset:          64 (aligned 64)
[  165.970000] UBI: data offset:                128
[  166.040000] UBI: attached mtd4 to ubi0
[  166.060000] UBI: MTD device name:            "User"
[  166.060000] UBI: MTD device size:            28 MiB
[  166.120000] UBI: number of good PEBs:        230
[  166.120000] UBI: number of bad PEBs:         0
[  166.120000] UBI: max. allowed volumes:       128
[  166.150000] UBI: wear-leveling threshold:    4096
[  166.150000] UBI: number of internal volumes: 1
[  166.150000] UBI: number of user volumes:     1
[  166.170000] UBI: available PEBs:             0
[  166.170000] UBI: total number of reserved PEBs: 230
[  166.190000] UBI: number of PEBs reserved for bad PEB handling: 0
[  166.230000] UBI: max/mean erase counter: 2/0
[  166.230000] UBI: image sequence number: 1748877991
[  166.260000] UBI: background thread "ubi_bgt0d" started, PID 2170
UBI device number 0, total 230 LEBs (30117120 bytes, 28.7 MiB), available 0 LEBs (0 bytes), LEB size 130944 bytes (127.9 KiB)
[  166.520000] UBIFS: recovery needed
[  166.680000] UBIFS error (pid 2177): ubifs_check_node: bad CRC: calculated 0x7d62d42c, read 0x1173c109
[  166.690000] UBIFS error (pid 2177): ubifs_check_node: bad node at LEB 84:50696
[  166.700000] UBIFS error (pid 2177): ubifs_read_node: expected node type 9
mount: mounting ubi0:rootfs on /skov/mnt/rootfs failed: Structure needs cleaning
#
---

So the question is if UBI can made to recover this situation???


Sincerely,

Dr. Karsten Jeppesen,
SKOV AS



More information about the linux-mtd mailing list