ubi問題總結【轉】

轉自:https://www.cnblogs.com/schips/p/13178836.html

掛載成功有時出現:

 
UBIFS error (pid 76): ubifs_read_node: bad node type (255 but expected 1)
UBIFS error (pid 76): ubifs_read_node: bad node at LEB 31:20480, LEB mapping status 0
UBIFS error (pid 76): do_readpage: cannot read page 0 of inode 70, error -22

1.在uboot裏,setenv nand_root ubi0:rootfs rw ubi.mtd= (此處對應),2048
2.製作imgae時,mkfs.ubifs -c 這個參數要仔細計算,些參數影響較大,再就是改一下ubinize.cfg這個文件的相關參數,要經過計算

3.看驅動,以用硬件連接,不要造成flash的只讀情況出現

ubifs_read_node 報錯,還會有類似oops的錯誤

 
UBIFS: default compressor: LZO
UBIFS: reserved for root:  0 bytes (0 KiB)
UBIFS error (pid 0): ubifs_read_node: bad node type (255 but expected 9)
UBIFS error (pid 0): ubifs_read_node: bad node at LEB 85:60448
UBIFS error (pid 0): ubifs_iget: failed to read inode 1, error -22
Machine check in kernel mode.
Caused by (from msr): regs 0fe7ca88 Unknown values in msr
NIP: 0FFB7C80 XER: 00000000 LR: 0FFB7C5C REGS: 0fe7ca88 TRAP: 0200 DAR: 00000000
MSR: 0000b032 EE: 1 PR: 0 FP: 1 ME: 1 IR/DR: 11

GPR00: 0004434C 0FE7CB78 0FE7CF50 FFFF7FFF 0FFF8020 00000000 0FFF8020 FFFF7FF7 
GPR08: 00021AE8 DC0FFF80 0FFF83F8 0FFF83F8 22044024 7037FFBF 0FFFB000 00000000 
GPR16: 0FFECF7C 0FFF691C 00000000 00000000 0FEE1310 0FEDFB28 FFFFF000 0FEE0BA0 
GPR24: 00000000 00000003 0FEE129C 00000001 00000001 0FFF9100 0FFFBFA8 0FEE0C88 
Call backtrace: 
0FEE0C88 0FFCABFC 0FFCBEE8 0FFCC050 0FFB6590 0FFBC468 0FFBBB78 
0FFBBD98 0FFBD728 0FFBC468 0FFBBB78 0FFBBD98 0FFBE7D0 0FFA188C 
0FFA05F0 
machine check
Resetting the board.

解決辦法:

關於這個oops的錯誤參考以下鏈接的修改

http://lists.denx.de/pipermail/u-boot/2011-October/103864.html

 
On Tue, Oct 4, 2011 at 6:08 PM, larsi <larsi at atlantis.wh2.tu-dresden.de> wrote:
 This patch fixes an issue when ubifs reads a bad superblock. Later it
 tries to free memory, that was not allocated, which freezes u-boot.
 This is fixed by looking for a non null pointer before free.

 Signed-off-by: Lars Poeschel <larsi at wh2.tu-dresden.de>
 Cc: Kyungmin Park <kmpark at infradead.org>
 ---
 The message I got before u-boot freezes:
 UBI: max/mean erase counter: 53/32
 UBIFS: mounted UBI device 0, volume 1, name "rootfs"
 UBIFS: mounted read-only
 UBIFS: file system size:   49140 bytes (50319360 KiB, 0 MiB, 49140 LEBs)
 UBIFS: journal size:       49 bytes (6838272 KiB, 0 MiB, 6678 LEBs)
 UBIFS: media format:       w4/r0 (latest is w4/r0)
 UBIFS: default compressor: LZO
 UBIFS: reserved for root:  0 bytes (0 KiB)
 UBIFS error (pid 0): ubifs_read_node: bad node type (255 but expected 9)
 UBIFS error (pid 0): ubifs_read_node: bad node at LEB 330:13104
 UBIFS error (pid 0): ubifs_iget: failed to read inode 1, error -22
 Error reading superblock on volume 'ubi:rootfs'!

  fs/ubifs/super.c |    6 ++++--
  1 files changed, 4 insertions(+), 2 deletions(-)

 diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
 index 63b2164..20fb244 100644
 --- a/fs/ubifs/super.c
 +++ b/fs/ubifs/super.c
 @@ -848,8 +848,10 @@ void ubifs_umount(struct ubifs_info *c)
        ubifs_debugging_exit(c);

        /* Finally free U-Boot's global copy of superblock */
 -       free(ubifs_sb->s_fs_info);
 -       free(ubifs_sb);
 +       if (ubifs_sb != null) {
 +               free(ubifs_sb->s_fs_info);
 +               free(ubifs_sb);
 +       }
Which statement is problem? Basically free() check the null address.
so If ubifs_sb->s_fs_info doesn't have value its skipped. and ubifs_sb
is similar.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章