Potential issue on UBIFS for Kernel 3.4.7

Fabien Comte fabien.comte at ercogener.com
Thu Aug 2 08:35:12 EDT 2012


Hello,

I migrated some products (embedded devices with 256 Mbytes NAND flash, about
5 products broken by the transition) from a kernel 3.4.4 (they had previous
versions before 3.4.4) to a 3.4.7. And after a clean shutdown (no power
cut), I got these messages and some files corrupted (random, not always the
same).

[    5.800000] UBIFS error (pid 884): ubifs_read_node: bad node type (255
but expected 2)
[    5.800000] UBIFS error (pid 884): ubifs_read_node: bad node type (255
but expected 2)
[    5.810000] UBIFS error (pid 884): ubifs_read_node: bad node at LEB
694:34816, LEB mapping status 0
[    5.810000] UBIFS error (pid 884): ubifs_read_node: bad node at LEB
694:34816, LEB mapping status 0
[    5.820000] UBIFS error (pid 885): ubifs_read_node: bad node type (255
but expected 2)
[    5.820000] UBIFS error (pid 885): ubifs_read_node: bad node type (255
but expected 2)
[    5.830000] UBIFS error (pid 885): ubifs_read_node: bad node at LEB
694:34816, LEB mapping status 0
[    5.830000] UBIFS error (pid 885): ubifs_read_node: bad node at LEB
694:34816, LEB mapping status 0
[   10.390000] UBIFS error (pid 968): ubifs_read_node: bad node type (255
but expected 2)
[   10.390000] UBIFS error (pid 968): ubifs_read_node: bad node type (255
but expected 2)
[   10.390000] UBIFS error (pid 968): ubifs_read_node: bad node at LEB
694:120832, LEB mapping status 0
[   10.390000] UBIFS error (pid 968): ubifs_read_node: bad node at LEB
694:120832, LEB mapping status 0

I noticed that the problem appends on products that worked few weeks with
previous versions of kernel (potentially a lot of writes on the NAND due to
logging applications running on the device). Problem is not on new products
if I flash them with a kernel 3.0.4 and jump directly to a 3.4.7 after few
minutes.

My boot arguments are :
ubi.mtd=7 root=ubi0:at91sam9260ek-rootfs rootfstype=ubifs
rootflags=sync,bulk_read,chk_data_crc,compr=lzo rw

MTD tests looks good.

On next commant, mtd7 is my rootfs and is formatted with UBIFS.

mtdinfo -a
Count of MTD devices:           8
Present MTD devices:            mtd0, mtd1, mtd2, mtd3, mtd4, mtd5, mtd6,
mtd7
Sysfs interface supported:      yes

mtd0
Name:                           bootstrap
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          1 (131072 bytes, 128.0 KiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  512 bytes
OOB size:                       64 bytes
Character device major/minor:   90:0
Bad blocks are allowed:         true
Device is writable:             true

mtd1
Name:                           uboot
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          4 (524288 bytes, 512.0 KiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  512 bytes
OOB size:                       64 bytes
Character device major/minor:   90:2
Bad blocks are allowed:         true
Device is writable:             true

mtd2
Name:                           env1
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          1 (131072 bytes, 128.0 KiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  512 bytes
OOB size:                       64 bytes
Character device major/minor:   90:4
Bad blocks are allowed:         true
Device is writable:             true

mtd3
Name:                           env2
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          1 (131072 bytes, 128.0 KiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  512 bytes
OOB size:                       64 bytes
Character device major/minor:   90:6
Bad blocks are allowed:         true
Device is writable:             true

mtd4
Name:                           spare
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          1 (131072 bytes, 128.0 KiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  512 bytes
OOB size:                       64 bytes
Character device major/minor:   90:8
Bad blocks are allowed:         true
Device is writable:             true

mtd5
Name:                           kernel1
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          28 (3670016 bytes, 3.5 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  512 bytes
OOB size:                       64 bytes
Character device major/minor:   90:10
Bad blocks are allowed:         true
Device is writable:             true

mtd6
Name:                           kernel2
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          28 (3670016 bytes, 3.5 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  512 bytes
OOB size:                       64 bytes
Character device major/minor:   90:12
Bad blocks are allowed:         true
Device is writable:             true

mtd7
Name:                           rootfs
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          1984 (260046848 bytes, 248.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  512 bytes
OOB size:                       64 bytes
Character device major/minor:   90:14
Bad blocks are allowed:         true
Device is writable:             true



ubinfo -a

UBI version:                    1
Count of UBI devices:           1
UBI control device major/minor: 10:63
Present UBI devices:            ubi0

ubi0
Volumes count:                           1
Logical eraseblock size:                 129024 bytes, 126.0 KiB
Total amount of logical eraseblocks:     1980 (255467520 bytes, 243.6 MiB)
Amount of available logical eraseblocks: 0 (0 bytes)
Maximum count of volumes                 128
Count of bad physical eraseblocks:       4
Count of reserved physical eraseblocks:  34
Current maximum erase counter value:     3
Minimum input/output unit size:          2048 bytes
Character device major/minor:            253:0
Present volumes:                         0

Volume ID:   0 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        1942 LEBs (250564608 bytes, 239.0 MiB)
State:       OK
Name:        at91sam9260ek-rootfs
Character device major/minor: 253:1

Do someone get any idea ?

Thank you.

Fabien






More information about the linux-mtd mailing list