Skip to contentSkip to conversation

Potential issue on UBIFS for Kernel 3.4.7

DISCUSSION Fabien Comte 2 participants 2 messages Aug 2, 2012 – Aug 24, 2012 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 7 lines · Fabien Comte

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).

The only UBIFS change between 3.4.4 and 3.4.7 is:

commit 863c806617059e412ade0b1bbb6d215106be14c1

Author: Artem Bityutskiy <[email protected]>
Date:   Sat Jul 14 14:33:09 2012 +0300

UBIFS: fix a bug in empty space fix-up

commit c6727932cfdb13501108b16c38463c09d5ec7a74 upstream.

I very much doubt it is guilty, but you can check.

But first you need to make sure you have a reliable setup prove that the upgrade cause the issue.

I'd got this way.

1. Save flash dump of a working device before the upgrade. Make sure you can always flash this flash image back and the system works fine.
2. Make sure you really have no problems with 3.4.4.
3. Upgrade to 3.4.7, reproduce the issue.
4. Put the saved image back.
5. Try to upgrade to 3.4.5, and see if it is reproducible.
6. Continue bisecting and find the guilty commit.

Signature · 2 lines
Best Regards,
Artem Bityutskiy