jffs2_gcd_mtd0 invoked oom-killer
Dear Sirs!
I work with the embedded system based on PowerPC 405 EP with 16Mb RAM and 32 Mb NAND FLASH. Rootfs lives on NAND FLASH and is formatted using jffs2.
A few months it worked just fine then suddenly the system became unusable. Since root fs locates on NAND flash, system became unloadable because of error. Anyway I can boot the
system, loading the kernel by TFTP and having mounted root fs by NFS.
When the system works with the kernel loaded by tftp and fs mounted by NFS, it all seems to be fine until the command
"mount -t jffs2 /dev/mtdblock0 /mnt" issued. After this command system tells me "check_node_data: wrong data CRC" and then "jffs2_gcd_mtd0 invoked oom-killer". Then it goes to reboot (see the log below). The problem occurs with 2.6.18-rc4 kernel and with 2.6.19.2-1 (the latest one I can build for my board).
Kernel config (those of 2.6.19.2-1) is attached at the very bottom of the letter.
Please advise the steps to fix the problem or direction to begin debugging.
Thank you, best regards,
Log:
bash-2.05b# mount -t jffs2 /dev/mtdblock0 /mnt
bash-2.05b# cat /proc/meminfo
MemTotal: 14088 kB MemFree: 1356 kB Buffers: 0 kB Cached: 5332 kB SwapCached: 0 kB Active: 4384 kB Inactive: 2336 kB SwapTotal: 0 kB SwapFree: 0 kB Dirty: 0 kB Writeback: 0 kB AnonPages: 1404 kB Mapped: 2224 kB Slab: 5024 kB SReclaimable: 588 kB SUnreclaim: 4436 kB PageTables: 152 kB NFS_Unstable: 0 kB Bounce: 0 kB CommitLimit: 7044 kB Committed_AS: 15080 kB VmallocTotal: 743424 kB VmallocUsed: 4684 kB VmallocChunk: 738600 kB bash-2.05b# cd /mnt/ bash-2.05b# ls -l total 0 drwxr-xr-x 2 500 500 0 Nov 22 2005 bin drwxrwxr-x 2 500 500 0 Nov 15 2005 boot drwxr-xr-x 2 500 500 0 Dec 31 1969 dev drwxr-xr-x 20 500 500 0 Dec 31 1969 etc drwxrwxr-x 2 root root 0 Nov 22 2005 info drwxr-xr-x 5 500 500 0 Dec 31 1969 lib drwxrwxr-x 4 500 500 0 Nov 22 2005 man drwxr-xr-x 2 root root 0 Dec 31 1969 mnt drwxrwxr-x 2 root root 0 Jul 28 2005 proc drwxrwxr-x 3 500 500 0 Dec 31 1969 root drwxr-xr-x 2 500 500 0 Dec 31 1969 sbin drwxrwxr-x 2 500 500 0 Nov 15 2005 share drwxr-xr-x 307 root root 0 Jan 1 1970 tmp drwxr-xr-x 2 root root 0 Dec 31 1969 tz-64 drwxr-xr-x 10 500 500 0 Nov 21 2005 usr drwxr-xr-x 8 500 500 0 Dec 31 1969 var bash-2.05b# cat /proc/meminfo MemTotal: 14088 kB MemFree: 796 kB Buffers: 0 kB Cached: 4556 kB SwapCached: 0 kB Active: 4252 kB Inactive: 1700 kB SwapTotal: 0 kB SwapFree: 0 kB Dirty: 0 kB Writeback: 0 kB AnonPages: 1412 kB Mapped: 2244 kB Slab: 6352 kB SReclaimable: 592 kB SUnreclaim: 5760 kB PageTables: 152 kB NFS_Unstable: 0 kB Bounce: 0 kB CommitLimit: 7044 kB Committed_AS: 15088 kB VmallocTotal: 743424 kB VmallocUsed: 4684 kB VmallocChunk: 738600 kB bash-2.05b# JFFS2 notice: (450) check_node_data: wrong data CRC in data node at 0x03b4bc00: read 0xc7ce044f, calculated 0xaba67eba. Dec 31 19:01:30 10 kernel: JFFS2 notice: (450) check_node_data: wrong data CRC in data node at 0x03b4bc00: read 0xc7ce044f, calculated 0xaba67eba.
bash-2.05b# jffs2_gcd_mtd0 invoked oom-killer: gfp_mask=0xd0, order=0, oomkilladj=0
Call Trace:
[C06A1D30] [C00089FC] (unreliable)
[C06A1D60] [C0039014]
[C06A1D90] [C003A3A0]
[C06A1DE0] [C004D044]
[C06A1E10] [C004CD58]
[C06A1E20] [C00CA314]
[C06A1E30] [C00CBD9C]
[C06A1EA0] [C00CC8D4]
[C06A1F10] [C00D02EC]
[C06A1F50] [C00D18F8]
[C06A1FF0] [C0004BB8]
Mem-info:
DMA per-cpu:
CPU 0: Hot: hi: 0, btch: 1 usd: 0 Cold: hi: 0, btch: 1 usd: 0
Active:336 inactive:0 dirty:0 writeback:0 unstable:0 free:127 slab:2824 mapped:0 pagetables:34
DMA free:508kB min:508kB low:632kB high:760kB active:1344kB inactive:0kB present:16256kB pages_scanned:2351 all_unreclaimable? yes lowmem_reserve[]: 0 0
DMA: 1*4kB 1*8kB 1*16kB 1*32kB 1*64kB 1*128kB 1*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 508kB
Free swap: 0kB
4096 pages of RAM
0 pages of HIGHMEM
148 free pages
575 reserved pages
0 pages shared
0 pages swap cached
Out of Memory: Kill process 391 (portmap) score 466 and children.
Out of memory: Killed process 391 (portmap).
klogd invoked oom-killer: gfp_mask=0x201d2, order=0, oomkilladj=0
Call Trace:
[C0D1BCD0] [C00089FC] (unreliable)
[C0D1BD00] [C0039014]
[C0D1BD30] [C003A3A0]
[C0D1BD80] [C003C248]
[C0D1BE00] [C0037808]
[C0D1BE30] [C0041A00]
[C0D1BE80] [C0009CF4]
[C0D1BF40] [C0003094]
Mem-info:
DMA per-cpu:
CPU 0: Hot: hi: 0, btch: 1 usd: 0 Cold: hi: 0, btch: 1 usd: 0
Active:336 inactive:0 dirty:0 writeback:0 unstable:0 free:126 slab:2825 mapped:0 pagetables:34
DMA free:504kB min:508kB low:632kB high:760kB active:1344kB inactive:0kB present:16256kB pages_scanned:2351 all_unreclaimable? yes lowmem_reserve[]: 0 0
DMA: 0*4kB 1*8kB 1*16kB 1*32kB 1*64kB 1*128kB 1*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 504kB
Free swap: 0kB
4096 pages of RAM
0 pages of HIGHMEM
147 free pages
575 reserved pages
0 pages shared
0 pages swap cached
klogd invoked oom-killer: gfp_mask=0x201d2, order=0, oomkilladj=0
Call Trace:
[C0D1BCD0] [C00089FC] (unreliable)
[C0D1BD00] [C0039014]
[C0D1BD30] [C003A3A0]
[C0D1BD80] [C003C248]
[C0D1BE00] [C0037808]
[C0D1BE30] [C0041A00]
[C0D1BE80] [C0009CF4]
[C0D1BF40] [C0003094]
Mem-info:
DMA per-cpu:
CPU 0: Hot: hi: 0, btch: 1 usd: 0 Cold: hi: 0, btch: 1 usd: 0
Active:313 inactive:26 dirty:0 writeback:0 unstable:0 free:127 slab:2826 mapped:1 pagetables:30
DMA free:508kB min:508kB low:632kB high:760kB active:1252kB inactive:104kB present:16256kB pages_scanned:2040 all_unreclaimable? yes lowmem_reserve[]: 0 0
DMA: 1*4kB 1*8kB 1*16kB 1*32kB 1*64kB 1*128kB 1*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 508kB
Free swap: 0kB
4096 pages of RAM
0 pages of HIGHMEM
148 free pages
575 reserved pages
2 pages shared
0 pages swap cached
Out of Memory: Kill process 422 (login) score 77 and children.
Out of memory: Killed process 423 (bash).
Dec 31 19:01:48 10 kernel: jffs2_gcd_mtd0 invoked oom-killer: gfp_mask=0xd0, order=0, oomkilladj=0 Dec 31 19:01:48 10 kernel: Call Trace: Dec 31 19:01:48 10 kernel: [C06A1D30] [C00089FC] (unreliable) Dec 31 19:01:48 10 kernel: [C06A1D60] [C0039014] Dec 31 19:01:48 10 kernel: [C06A1D90] [C003A3A0] Dec 31 19:01:48 10 kernel: [C06A1DE0] [C004D044] Dec 31 19:01:48 10 kernel: [C06A1E10] [C004CD58] Dec 31 19:01:48 10 kernel: [C06A1E20] [C00CA314] Dec 31 19:01:48 10 kernel: [C06A1E30] [C00CBD9C] Dec 31 19:01:48 10 kernel: [C06A1EA0] [C00CC8D4] Dec 31 19:01:48 10 kernel: [C06A1F10] [C00D02EC] Dec 31 19:01:48 10 kernel: [C06A1F50] [C00D18F8] Dec 31 19:01:48 10 kernel: [C06A1FF0] [C0004BB8] Dec 31 19:01:48 10 kernel: Mem-info: Dec 31 19:01:48 10 kernel: DMA per-cpu: Dec 31 19:01:48 10 kernel: CPU 0: Hot: hi: 0, btch: 1 usd: 0 Cold: hi: 0, btch: 1 usd: 0 Dec 31 19:01:48 10 kernel: Active:336 inactive:0 dirty:0 writeback:0 unstable:0 free:127 slab:2824 mapped:0 pagetables:34 Dec 31 19:01:48 10 kernel: DMA free:508kB min:508kB low:632kB high:760kB active:1344kB inactive:0kB present:16256kB pages_scanned:2351 all_unreclaimable? yes Dec 31 19:01:48 10 kernel: lowmem_reserve[]: 0 0 Dec 31 19:01:48 10 kernel: DMA: 1*4kB 1*8kB 1*16kB 1*32kB 1*64kB 1*128kB 1*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 508kB Dec 31 19:01:48 10 kernel: Free swap: 0kB Dec 31 19:01:48 10 kernel: 4096 pages of RAM Dec 31 19:01:48 10 kernel: 0 pages of HIGHMEM Dec 31 19:01:48 10 kernel: 148 free pages Dec 31 19:01:48 10 kernel: 575 reserved pages Dec 31 19:01:48 10 kernel: 0 pages shared Dec 31 19:01:48 10 kernel: 0 pages swap cached Dec 31 19:01:49 10 kernel: Out of Memory: Kill process 391 (portmap) score 466 and children. Dec 31 19:01:49 10 kernel: Out of memory: Killed process 391 (portmap). Dec 31 19:01:49 10 kernel: klogd invoked oom-killer: gfp_mask=0x201d2, order=0, oomkilladj=0 Dec 31 19:01:49 10 kernel: Call Trace: Dec 31 19:01:49 10 kernel: [C0D1BCD0] [C00089FC] (unreliable) Dec 31 19:01:49 10 kernel: [C0D1BD00] [C0039014] Dec 31 19:01:49 10 kernel: [C0D1BD30] [C003A3A0] Dec 31 19:01:49 10 kernel: [C0D1BD80] [C003C248] Dec 31 19:01:49 10 kernel: [C0D1BE00] [C0037808] Dec 31 19:01:49 10 kernel: [C0D1BE30] [C0041A00] Dec 31 19:01:49 10 kernel: [C0D1BE80] [C0009CF4] Dec 31 19:01:49 10 kernel: [C0D1BF40] [C0003094] Dec 31 19:01:49 10 kernel: Mem-info: Dec 31 19:01:49 10 kernel: DMA per-cpu: Dec 31 19:01:49 10 kernel: CPU 0: Hot: hi: 0, btch: 1 usd: 0 Cold: hi: 0, btch: 1 usd: 0 Dec 31 19:01:49 10 kernel: Active:336 inactive:0 dirty:0 writeback:0 unstable:0 free:126 slab:2825 mapped:0 pagetables:34 Dec 31 19:01:49 10 kernel: DMA free:504kB min:508kB low:632kB high:760kB active:1344kB inactive:0kB present:16256kB pages_scanned:2351 all_unreclaimable? yes Dec 31 19:01:49 10 kernel: lowmem_reserve[]: 0 0 Dec 31 19:01:49 10 kernel: DMA: 0*4kB 1*8kB 1*16kB 1*32kB 1*64kB 1*128kB 1*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 504kB Dec 31 19:01:49 10 kernel: Free swap: 0kB Dec 31 19:01:49 10 kernel: 4096 pages of RAM Dec 31 19:01:49 10 kernel: 0 pages of HIGHMEM Dec 31 19:01:49 10 kernel: 147 free pages Dec 31 19:01:49 10 kernel: 575 reserved pages Dec 31 19:01:49 10 kernel: 0 pages shared Dec 31 19:01:49 10 kernel: 0 pages swap cached Dec 31 19:01:49 10 kernel: klogd invoked oom-killer: gfp_mask=0x201d2, order=0, oomkilladj=0 Dec 31 19:01:49 10 kernel: Call Trace: Dec 31 19:01:49 10 kernel: [C0D1BCD0] [C00089FC] (unreliable) Dec 31 19:01:49 10 kernel: [C0D1BD00] [C0039014] Dec 31 19:01:49 10 kernel: [C0D1BD30] [C003A3A0] Dec 31 19:01:49 10 kernel: [C0D1BD80] [C003C248] Dec 31 19:01:49 10 kernel: [C0D1BE00] [C0037808] Dec 31 19:01:49 10 kernel: [C0D1BE30] [C0041A00] Dec 31 19:01:49 10 kernel: [C0D1BE80] [C0009CF4] Dec 31 19:01:49 10 kernel: [C0D1BF40] [C0003094] Dec 31 19:01:49 10 kernel: Mem-info: Dec 31 19:01:49 10 kernel: DMA per-cpu: Dec 31 19:01:49 10 kernel: CPU 0: Hot: hi: 0, btch: 1 usd: 0 Cold: hi: 0, btch: 1 usd: 0 Dec 31 19:01:49 10 kernel: Active:313 inactive:26 dirty:0 writeback:0 unstable:0 free:127 slab:2826 mapped:1 pagetables:30 Dec 31 19:01:49 10 kernel: DMA free:508kB min:508kB low:632kB high:760kB active:1252kB inactive:104kB present:16256kB pages_scanned:2040 all_unreclaimable? yes Dec 31 19:01:49 10 kernel: lowmem_reserve[]: 0 0 Dec 31 19:01:49 10 kernel: DMA: 1*4kB 1*8kB 1*16kB 1*32kB 1*64kB 1*128kB 1*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 508kB Dec 31 19:01:49 10 kernel: Free swap: 0kB Dec 31 19:01:49 10 kernel: 4096 pages of RAM Dec 31 19:01:49 10 kernel: 0 pages of HIGHMEM Dec 31 19:01:49 10 kernel: 148 free pages Dec 31 19:01:49 10 kernel: 575 reserved pages Dec 31 19:01:49 10 kernel: 2 pages shared Dec 31 19:01:49 10 kernel: 0 pages swap cached Dec 31 19:01:49 10 kernel: Out of Memory: Kill process 422 (login) score 77 and children. Dec 31 19:01:49 10 kernel: Out of memory: Killed process 423 (bash).
INIT: cannot fork, retry..
Config:
[igor@tps linux-2.6.19.2-1]$ cat .config | grep = CONFIG_MMU=yCONFIG_GENERIC_HARDIRQS=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_GENERIC_HWEIGHT=y CONFIG_GENERIC_CALIBRATE_DELAY=yCONFIG_PPC=yCONFIG_PPC32=yCONFIG_GENERIC_NVRAM=y CONFIG_GENERIC_FIND_NEXT_BIT=y CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" CONFIG_EXPERIMENTAL=yCONFIG_BROKEN_ON_SMP=y CONFIG_INIT_ENV_ARG_LIMIT=32 CONFIG_LOCALVERSION=""CONFIG_LOCALVERSION_AUTO=yCONFIG_SYSVIPC=yCONFIG_INITRAMFS_SOURCE="" CONFIG_CC_OPTIMIZE_FOR_SIZE=yCONFIG_SYSCTL=yCONFIG_EMBEDDED=yCONFIG_SYSCTL_SYSCALL=yCONFIG_PRINTK=yCONFIG_BUG=yCONFIG_ELF_CORE=yCONFIG_BASE_FULL=yCONFIG_FUTEX=yCONFIG_SHMEM=yCONFIG_SLAB=yCONFIG_VM_EVENT_COUNTERS=yCONFIG_RT_MUTEXES=yCONFIG_BASE_SMALL=0CONFIG_MODULES=yCONFIG_MODULE_UNLOAD=y CONFIG_MODULE_FORCE_UNLOAD=yCONFIG_KMOD=yCONFIG_BLOCK=yCONFIG_IOSCHED_NOOP=yCONFIG_IOSCHED_AS=yCONFIG_IOSCHED_DEADLINE=yCONFIG_IOSCHED_CFQ=yCONFIG_DEFAULT_AS=y CONFIG_DEFAULT_IOSCHED="anticipatory"
CONFIG_40x=y
CONFIG_4xx=y
CONFIG_PPChameleonEVB=yCONFIG_TZ_64=yCONFIG_IBM_OCP=yCONFIG_405EP=yCONFIG_PPC_GEN550=yCONFIG_UART0_TTYS0=yCONFIG_NOT_COHERENT_CACHE=y CONFIG_ARCH_POPULATES_NODE_MAP=yCONFIG_HZ_100=yCONFIG_HZ=100CONFIG_PREEMPT_NONE=yCONFIG_SELECT_MEMORY_MODEL=y CONFIG_FLATMEM_MANUAL=yCONFIG_FLATMEM=yCONFIG_FLAT_NODE_MEM_MAP=y CONFIG_SPLIT_PTLOCK_CPUS=4CONFIG_BINFMT_ELF=yCONFIG_SECCOMP=yCONFIG_ISA_DMA_API=y CONFIG_HIGHMEM_START=0xfe000000 CONFIG_LOWMEM_SIZE=0x30000000 CONFIG_KERNEL_START=0xc0000000 CONFIG_TASK_SIZE=0x80000000 CONFIG_CONSISTENT_START=0xff100000 CONFIG_CONSISTENT_SIZE=0x00200000 CONFIG_BOOT_LOAD=0x00400000CONFIG_NET=yCONFIG_PACKET=yCONFIG_UNIX=yCONFIG_XFRM=yCONFIG_INET=yCONFIG_IP_MULTICAST=yCONFIG_IP_FIB_HASH=yCONFIG_IP_PNP=yCONFIG_IP_PNP_DHCP=yCONFIG_SYN_COOKIES=y CONFIG_INET_XFRM_MODE_TRANSPORT=y CONFIG_INET_XFRM_MODE_TUNNEL=y CONFIG_INET_XFRM_MODE_BEET=yCONFIG_INET_DIAG=yCONFIG_INET_TCP_DIAG=yCONFIG_TCP_CONG_CUBIC=y CONFIG_DEFAULT_TCP_CONG="cubic" CONFIG_PREVENT_FIRMWARE_BUILD=yCONFIG_MTD=yCONFIG_MTD_DEBUG=yCONFIG_MTD_DEBUG_VERBOSE=2CONFIG_MTD_PARTITIONS=yCONFIG_MTD_CHAR=yCONFIG_MTD_BLOCK=yCONFIG_MTD_MAP_BANK_WIDTH_1=y CONFIG_MTD_MAP_BANK_WIDTH_2=y CONFIG_MTD_MAP_BANK_WIDTH_4=yCONFIG_MTD_CFI_I1=yCONFIG_MTD_CFI_I2=yCONFIG_MTD_COMPLEX_MAPPINGS=yCONFIG_MTD_NAND=yCONFIG_MTD_NAND_IDS=y CONFIG_MTD_NAND_PPCHAMELEONEVB=y CONFIG_BLK_DEV_LOOP=yCONFIG_BLK_DEV_RAM=yCONFIG_BLK_DEV_RAM_COUNT=4 CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 CONFIG_BLK_DEV_INITRD=yCONFIG_NETDEVICES=yCONFIG_NET_ETHERNET=yCONFIG_MII=yCONFIG_IBM_EMAC=yCONFIG_IBM_EMAC_RXB=64CONFIG_IBM_EMAC_TXB=32 CONFIG_IBM_EMAC_POLL_WEIGHT=32 CONFIG_IBM_EMAC_RX_COPY_THRESHOLD=256 CONFIG_IBM_EMAC_RX_SKB_HEADROOM=0CONFIG_INPUT=yCONFIG_SERIAL_8250=yCONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_NR_UARTS=4 CONFIG_SERIAL_8250_RUNTIME_UARTS=4 CONFIG_SERIAL_CORE=yCONFIG_SERIAL_CORE_CONSOLE=yCONFIG_UNIX98_PTYS=yCONFIG_LEGACY_PTYS=yCONFIG_LEGACY_PTY_COUNT=256CONFIG_HW_RANDOM=yCONFIG_GEN_RTC=yCONFIG_HWMON=yCONFIG_FIRMWARE_EDID=yCONFIG_EXT2_FS=yCONFIG_EXT2_FS_XATTR=yCONFIG_EXT2_FS_POSIX_ACL=yCONFIG_EXT2_FS_XIP=yCONFIG_FS_XIP=yCONFIG_FS_MBCACHE=yCONFIG_FS_POSIX_ACL=yCONFIG_INOTIFY=yCONFIG_INOTIFY_USER=yCONFIG_DNOTIFY=yCONFIG_PROC_FS=yCONFIG_PROC_KCORE=yCONFIG_PROC_SYSCTL=yCONFIG_SYSFS=yCONFIG_TMPFS=yCONFIG_RAMFS=yCONFIG_JFFS2_FS=yCONFIG_JFFS2_FS_DEBUG=0 CONFIG_JFFS2_FS_WRITEBUFFER=y CONFIG_JFFS2_COMPRESSION_OPTIONS=y CONFIG_JFFS2_ZLIB=yCONFIG_JFFS2_RTIME=yCONFIG_JFFS2_CMODE_PRIORITY=yCONFIG_CRAMFS=yCONFIG_NFS_FS=yCONFIG_NFS_V3=yCONFIG_NFS_V3_ACL=yCONFIG_NFS_V4=yCONFIG_ROOT_NFS=yCONFIG_LOCKD=yCONFIG_LOCKD_V4=yCONFIG_NFS_ACL_SUPPORT=yCONFIG_NFS_COMMON=yCONFIG_SUNRPC=yCONFIG_SUNRPC_GSS=yCONFIG_RPCSEC_GSS_KRB5=y CONFIG_PARTITION_ADVANCED=yCONFIG_NLS=yCONFIG_NLS_DEFAULT="iso8859-1"CONFIG_NLS_ASCII=yCONFIG_CRC32=yCONFIG_ZLIB_INFLATE=yCONFIG_ZLIB_DEFLATE=yCONFIG_PLIST=yCONFIG_ENABLE_MUST_CHECK=yCONFIG_DEBUG_KERNEL=yCONFIG_LOG_BUF_SHIFT=14CONFIG_DETECT_SOFTLOCKUP=y CONFIG_FORCED_INLINING=yCONFIG_PPC_OCP=yCONFIG_CRYPTO=yCONFIG_CRYPTO_ALGAPI=yCONFIG_CRYPTO_BLKCIPHER=yCONFIG_CRYPTO_MANAGER=yCONFIG_CRYPTO_MD5=yCONFIG_CRYPTO_ECB=mCONFIG_CRYPTO_CBC=yCONFIG_CRYPTO_DES=y
Best regards,
Igor Marnat
mailto:[email protected]
Quoted 11 lines · Igor Marnat
Dear Sirs!
I work with the embedded system based on PowerPC 405 EP with 16Mb RAM and 32 Mb NAND FLASH. Rootfs lives on NAND FLASH and is formatted using jffs2.
A few months it worked just fine then suddenly the system became unusable. Since root fs locates on NAND flash, system became unloadable because of error. Anyway I can boot the
system, loading the kernel by TFTP and having mounted root fs by NFS.
Quoted 7 lines
When the system works with the kernel loaded by tftp and fs mounted by NFS, it all seems to be fine until the command
"mount -t jffs2/dev/mtdblock0/mnt" issued. After this command system tells me "f: wrong data CRC" and then "jffs2_gcd_mtd0invoked
oom-killer". Then it goes to reboot (see the log below). The problem occurs with 2.6.18-rc4 kernel and with 2.6.19.2-1 (the latest one I can build for my board).
Well, in general it may happen since JFFS2 needs a lot of memory. But 16MiB for 32MiB flash looks enough. Does something else consume much memory in your system so too few is left for JFFS2? Check how much RAM do you have for JFFS2.
Signature · 2 lines
Best regards, Artem Bityutskiy (Битюцкий Артём)
Hello Artem and List!
After some investigations I found some details of the problem, hope it helps.
Having mounted the /dev/mtdblock0 device the jffs2 kernel thread begins garbage collection. In a function jffs2_get_inode_nodes it tries to assemble the chain of nodes of inode (if I got it correctly).
I printed the common length of chain of nodes, it is generally 2 or
3, in rare cases it is bigger than 3. My file system on this NAND is corrupted in 2 places (at least). At the first time loop "while (valid_ref)" in jffs2_get_inode_nodes is passed about 28000 times and (I guess) system considers this chain as consisted of
28000 items. This chain passes successfully crc check
of node header in jffs2_get_inode_nodes. Anyway it doesn't pass CRC check later. It writes the message "JFFS2 notice: (450) check_node_data: wrong data CRC in data
node at" and process continues.
But it cannot pass the second corrupted place. It doesn't meet the NULL node, so the valid_ref is always not NULL. It passes crc check of node header, so the loop continues till the system exhausted all the
memory available (there are calls to kmalloc in the loop). When the chain length grows up to 110000 entries, oom killer begins to stop kernel threads and a bit later all the system reboots.
The problem is big for me, it is not a problem when some file gets corrupted but it shouldn't prevent the whole system from running, especially when the fs in problem is not the root fs.
So the questions are:
1. May be the function jffs2_get_inode_nodes can be improved? It's possible to pre-calculate chain length before trying to read it into the memory and allocate memory for it. It can be considered as broken if it's length exceeds some pre-defined maximum.
2. What can I do with the broken filesystem? Can I repair it?
3. Any other ideas or considerations?
I tried it on a several kernel versions, including 2.6.20.3.
Thank you for your help,
Best regards,
Igor Marnat
mailto:[email protected]
Quoted 6 lines · Igor Marnat
But it cannot pass the second corrupted place. It doesn't meet the NULL node, so the
valid_refis always not NULL. It passes crc check of node header, so the loop continues till the system exhausted all the
memory available (there are calls to kmalloc in the loop). When the chain length grows up to 110000 entries, oom killer begins to stop kernel threads and a bit later all the system reboots.
Can you please dump the mtd partition with the corrupt data with nanddump:
# nanddump -b -f nand.dmp /dev/mtdX
compress it with bz2 and put it somewhere to download.
Thanks,
tglx
Hello Thomas,
TG> Can you please dump the mtd partition with the corrupt data with TG> nanddump:
TG> # nanddump -b -f nand.dmp /dev/mtdX
I put it to ftp://ftp.tz.ru/pub/nand.dmp.bz2.
It's size is 26 MB. Nanddump didn't want to accept options you provided, so I did the dump with command "nanddump /dev/mtd0 nand.dmp". Please tell me if it is wrong.
Hope the image helps,
Best regards,
Igor Marnat
mailto:[email protected]
Quoted 5 lines · Igor Marnat
Hello Thomas,
TG> Can you please dump the mtd partition with the corrupt data with TG> nanddump:
Quoted 7 lines
TG> # nanddump -b -f nand.dmp
/dev/mtdXI put it to ftp://ftp.tz.ru/pub/nand.dmp.bz2.
It's size is 26 MB. Nanddump didn't want to accept options you provided, so I did the dump with command "nanddump
/dev/mtd0nand.dmp". Please tell me if it is wrong.
No. I probably looked at an old version.
Your flash is full of corrupted nodes. Most of them belong to
the files: "messages" and "wtmp"
Invalid Inode node at 0x000253ec, totlen 0x00000130, #ino 1807, version 106033, isize 428154883, csize 4597, dsize 4597, offset 37875712 Invalid Inode node at 0x00025a14, totlen 0x00000046, #ino 8620, version 470658, isize 1019416371, csize 3596, dsize 3596, offset 5997846 Invalid Inode node at 0x00025e20, totlen 0x00000091, #ino 8620, version 470663, isize 5997941, csize 3438493594, dsize 4294927703, offset 5997864
Interrestingly enough are the node CRCs of some of the nodes intact, so the corruption must have happened before writing to flash.
Does the patch below help ?
tglx
--------------------->
Subject: JFFS2: Check inode CRC first
Corrupted inodes need to be sorted out before anything else is done on them.
fs/jffs2/scan.c +15 -14
@@ -952,7 +952,7 @@ static int jffs2_scan_inode_node(struct jffs2_sb_info *c, struct jffs2_erasebloc struct jffs2_raw_inode *ri, uint32_t ofs, struct jffs2_summary *s) { struct jffs2_inode_cache *ic; -uint32_t ino =je32_to_cpu (ri->ino); +uint32_t crc, ino =je32_to_cpu (ri->ino);int err;D1 (printk (KERN_DEBUG "jffs2_scan_inode_node(): Node at 0x%08x\n" , ofs));
@@ -966,21 +966,22 @@ static int jffs2_scan_inode_node(struct jffs2_sb_info *c, struct jffs2_eraseblocWhich means that the _full_ amount of time to get to proper write mode with GC operational may actually be _longer_ than before. Sucks to be me. */ +/* Check the node CRC in any case. */ + crc =crc32 (0 , ri,sizeof (*ri)-8 ); +if (crc !=je32_to_cpu (ri->node_crc)) { +printk (KERN_NOTICE "jffs2_scan_inode_node(): CRC failed on " +"node at 0x%08x: Read 0x%08x, calculated 0x%08x\n" , + ofs,je32_to_cpu (ri->node_crc), crc); +/* +* We believe totlen because the CRC on the node +* _header_ was OK, just the node itself failed. +*/ +return jffs2_scan_dirty_space (c, jeb, + PAD(je32_to_cpu(ri->totlen)); + } + ic =jffs2_get_ino_cache (c, ino);if (!ic) { -/* Inocache get failed. Either we read a bogus ino# or it's just genuinely the -first node we found for this inode. Do a CRC check to protect against the former -case */ -uint32_t crc =crc32 (0 , ri,sizeof (*ri)-8 ); - -if (crc !=je32_to_cpu (ri->node_crc)) { -printk (KERN_NOTICE "jffs2_scan_inode_node(): CRC failed on node at 0x%08x: Read 0x%08x, calculated 0x%08x\n" , - ofs,je32_to_cpu (ri->node_crc), crc); -/* We believe totlen because the CRC on the node _header_ was OK, just the node itself failed. */ -if ((err =jffs2_scan_dirty_space (c, jeb,PAD (je32_to_cpu (ri->totlen))))) -return err; -return 0 ; - } ic =jffs2_scan_make_ino_cache (c, ino);if (!ic)return -ENOMEM ;
Hello Thomas,
TG> Invalid Inode node at 0x000253ec, totlen 0x00000130, #ino 1807, version 106033, isize 428154883, csize 4597, dsize 4597, offset 37875712 TG> Invalid Inode node at 0x00025a14, totlen 0x00000046, #ino 8620, version 470658, isize 1019416371, csize 3596, dsize 3596, offset 5997846 TG> Invalid Inode node at 0x00025e20, totlen 0x00000091, #ino 8620, version 470663, isize 5997941, csize 3438493594, dsize 4294927703, offset 5997864
TG> Interrestingly enough are the node CRCs of some of the nodes intact, so TG> the corruption must have happened before writing to flash.
TG> Does the patch below help ?
Unfortunately no, it still crashes in the same way.
Should I attach any debug output or something?
Signature · 3 lines
Best regards, Igor Marnat mailto:[email protected]
Hello Thomas,
TG> Interrestingly enough are the node CRCs of some of the nodes intact, so TG> the corruption must have happened before writing to flash.
Loop "while (valid_ref)" (those that become infinite) in jffs2_get_inode_nodes also contains crc checking of nodes. They are checked in order of proceeding.
It doesn't complain about nodes' crc, so it seems
that crc are ok. So I don't think that crc checking of chain of nodes helps here.
Signature · 3 lines
Best regards, Igor Marnat mailto:[email protected]
Quoted 11 lines · Igor Marnat
Hello Thomas,
TG> Interrestingly enough are the node CRCs of some of the nodes intact, so TG> the corruption must have happened before writing to flash.
Loop "while (
valid_ref)" (those that become infinite) injffs2_get_inode_nodesalso contains crc checking of nodes. They are checked in order of proceeding.It doesn't complain about nodes' crc, so it seems
that crc are ok. So I don't think that crc checking of chain of nodes helps here.
Can you please set JFFS2_DEBUG_LEVEL to 2 and log the output to a serial console, bzip2 the result and upload it somewhere ?
Beware: it's slow and huge!
Thanks,
tglx
Hello Thomas,
TG> Can you please set JFFS2_DEBUG_LEVEL to 2 and log the output to a serial TG> console, bzip2 the result and upload it somewhere ?
TG> Beware: it's slow and huge!
I put it to ftp://ftp.tz.ru/pub/jffs2.log.bz2.
Tell me if you need any additional details.
Best regards,
Igor Marnat
mailto:[email protected]