UBI errors when "ls -l"

Yan Kong ykong at sierrawireless.com
Mon Dec 15 00:53:51 PST 2014


> If the ID bytes are correct everything work fine.
Yes, the id is read from nand flash. If nandsim is correct, then something wrong exits in mtd drivers. I need to check it with FAE. Thank you.

I make a simple ubi image, only contains one folder "bin", "bin" only contains two files: only "busybox" and "vi". 


ykong at CNSHZ-ED-ARM01:~/rootfs/test_rootfs/bin$ ls -l
total 664
-rwxr-xr-x 1 ykong ykong 676432 Dec 14 22:48 busybox
lrwxrwxrwx 1 ykong ykong      7 Dec  4 20:22 vi -> busybox

When mounting this image, errors like:
[13667.440498] UBIFS error (pid 429): ubifs_lookup: dead directory entry 'vi', error -22
But 'vi' is not directory.....

It seems OK when "bin" only contains "busybox".

How do you think about it? Thank you.

Whole logs:

root at swi-mdm9x15:/mnt/flash# cd /mnt/ubifs/bin/
[13667.193772] UBIFS error (pid 429): ubifs_check_node: bad magic 0xce703d7f, expected 0x6101831
[13667.202165] UBIFS error (pid 429): ubifs_check_node: bad node at LEB 13:4032
[13667.208574] UBIFS error (pid 429): ubifs_read_node: expected node type 9
[13667.215685] UBIFS error (pid 429): ubifs_check_node: bad magic 0xce703d7f, expected 0x6101831
[13667.224140] UBIFS error (pid 429): ubifs_check_node: bad node at LEB 13:4032
[13667.230762] UBIFS error (pid 429): ubifs_read_node: expected node type 9
[13667.237752] UBIFS error (pid 429): ubifs_check_node: bad magic 0xce7038bf, expected 0x6101831
[13667.246297] UBIFS error (pid 429): ubifs_check_node: bad node at LEB 13:4032
[13667.253256] UBIFS error (pid 429): ubifs_read_node: expected node type 9
[13667.260031] UBIFS error (pid 429): ubifs_check_node: bad magic 0xce7038bf, expected 0x6101831
[13667.268699] UBIFS error (pid 429): ubifs_check_node: bad node at LEB 13:4032
[13667.275505] UBIFS error (pid 429): ubifs_read_node: expected node type 9
[13667.282189] UBIFS error (pid 429): ubifs_iget: failed to read inode 67, error -117
[13667.289514] UBIFS error (pid 429): ubifs_lookup: dead directory entry 'vi', error -117
[13667.298212] UBIFS warning (pid 429): ubifs_ro_mode: switched to read-only mode, error -117
[13667.306087] [<c0015568>] (unwind_backtrace+0x0/0x138) from [<c068f590>] (dump_stack+0x20/0x24)
[13667.314571] [<c068f590>] (dump_stack+0x20/0x24) from [<c025c584>] (ubifs_ro_mode+0x74/0x80)
[13667.322995] [<c025c584>] (ubifs_ro_mode+0x74/0x80) from [<c0257688>] (ubifs_lookup+0xfc/0x150)
[13667.331480] [<c0257688>] (ubifs_lookup+0xfc/0x150) from [<c0133d3c>] (__lookup_hash+0xc0/0xf8)
[13667.339873] [<c0133d3c>] (__lookup_hash+0xc0/0xf8) from [<c0133fe4>] (do_lookup+0x270/0x2b0)
[13667.348632] [<c0133fe4>] (do_lookup+0x270/0x2b0) from [<c0135df8>] (path_lookupat+0x10c/0x700)
[13667.357178] [<c0135df8>] (path_lookupat+0x10c/0x700) from [<c0136418>] (do_path_lookup+0x2c/0x68)
[13667.366029] [<c0136418>] (do_path_lookup+0x2c/0x68) from [<c0137de8>] (user_path_at_empty+0x68/0x98)
[13667.375154] [<c0137de8>] (user_path_at_empty+0x68/0x98) from [<c0137e3c>] (user_path_at+0x24/0x2c)
[13667.384097] [<c0137e3c>] (user_path_at+0x24/0x2c) from [<c012dea4>] (vfs_fstatat+0x40/0x78)
[13667.392337] [<c012dea4>] (vfs_fstatat+0x40/0x78) from [<c012df38>] (vfs_stat+0x2c/0x30)
[13667.400151] [<c012df38>] (vfs_stat+0x2c/0x30) from [<c012e160>] (sys_stat64+0x24/0x40)
[13667.408360] [<c012e160>] (sys_stat64+0x24/0x40) from [<c000e6a0>] (ret_fast_syscall+0x0/0x30)
[13667.416876] UBIFS error (pid 429): ubifs_read_node: bad node type (0 but expected 9)
[13667.424475] UBIFS error (pid 429): ubifs_read_node: bad node at LEB 13:4032, LEB mapping status 1
[13667.433326] UBIFS error (pid 429): ubifs_iget: failed to read inode 67, error -22
[13667.440498] UBIFS error (pid 429): ubifs_lookup: dead directory entry 'vi', error -22
busybox  vi       



-----Original Message-----
From: Richard Weinberger [mailto:richard at nod.at] 
Sent: 2014年12月15日 16:37
To: Yan Kong
Cc: linux-mtd at lists.infradead.org
Subject: Re: UBI errors when "ls -l"

Hi!

Am 15.12.2014 um 04:30 schrieb Yan Kong:
> Hi Richard,
> 
> The FAE tell me that now mtd driver doesn't support only write OOB area, but not write data area. So mtd_oobtest.

This sentence does not parse.

> But they are not sure if it is related to the UBI error. What do you think about it?

Fact is that mtd_read() returns less bytes than requested. This must not happen and is most likely a driver issue.
I'd start investigating here.
Almost all "UBI issues" I inspect for customers turn out to be plain mtd driver bugs.

> Another thing is that, I tried to enable nandsim in my Kernel, but saw that "Sub-page size" and "OOB size" of nandsim partition are different from local mtd partition's.
> The parameter of nandsim are as follows, which is copied from boot up logs.
> Command of insmod nandsim is:
> modprobe nandsim first_id_byte=0x2c second_id_byte=0xac 
> third_id_byte=0x90 fourth_id_byte=0x26 Is the parameter I used wrong?

If the ID bytes are correct everything work fine.

Thanks,
//richard


More information about the linux-mtd mailing list