UBIFS LEB properties tree with odd addresses

Winchenbach, Samuel Samuel-Winchenbach at idexx.com
Thu Nov 17 07:27:41 PST 2016


Please see the attached file for dmesg output.

# mount -t debugfs none /sys/kernel/debug/
# echo 'format "UBI DBG" +pf' > /sys/kernel/debug/dynamic_debug/control
# echo 'format "UBIFS DBG" +pf' > /sys/kernel/debug/dynamic_debug/control
#
#
# ubiformat -y /dev/mtd1
ubiformat: mtd1 (nor), size 32505856 bytes (31.0 MiB), 248 eraseblocks
of 131072 bytes (128.0 KiB), min. I/O size 1 bytes
lrandom: nonblocking pool is initialized complete
ibscan: scanning eraseblock 247 -- 100 % complete
ubiformat: 248 eraseblocks have valid erase counter, mean value is 2
ubiformat: formatting eraseblock 247 -- 100 % complete
#
#
# ubiattach -p /dev/mtd1
ubi0: attaching mtd1
ubi0: scanning is finished
ubi0: attached mtd1 (name "nv-storage", size 31 MiB)
ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 130944 bytes
ubi0: min./max. I/O unit sizes: 1/512, sub-page size 1
ubi0: VID header offset: 64 (aligned 64), data offset: 128
ubi0: good PEBs: 248, bad PEBs: 0, corrupted PEBs: 0
ubi0: user volume: 0, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 3/3, WL threshold: 4096, image sequence
number: 179136384
ubi0: available PEBs: 244, total reserved PEBs: 4, PEBs reserved for bad
PEB handling: 0
ubi0: background thread "ubi_bgt0d" started, PID 782
UBI device number 0, total 248 LEBs (32474112 bytes, 31.0 MiB),
available 244 LEBs (31950336 bytes, 30.5 MiB), LEB size 130944 bytes
(127.9 KiB)
#
#
# ubimkvol /dev/ubi0 -N persist -m
Set volume size to 31950336
Volume ID 0, size 244 LEBs (31950336 bytes, 30.5 MiB), LEB size 130944
bytes (127.9 KiB), dynamic, name "persist", alignment 1
#
#
# mount -t ubifs /dev/ubi0_0 /mnt
UBIFS (ubi0:0): default file-system created
UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 787
UBIFS error (ubi0:0 pid 785): check_lpt_type.constprop.6: invalid type
(9) in LPT node type 2
CPU: 1 PID: 785 Comm: mount Not tainted 4.6.0-xilinx #1
Hardware name: Xilinx Zynq Platform
[<c010ee78>] (unwind_backtrace) from [<c010ae88>] (show_stack+0x10/0x14)
[<c010ae88>] (show_stack) from [<c0304428>] (dump_stack+0x80/0x9c)
[<c0304428>] (dump_stack) from [<c02c0020>]
(check_lpt_type.constprop.6+0x3c/0x50)
[<c02c0020>] (check_lpt_type.constprop.6) from [<c02c2014>]
(ubifs_lpt_init+0x124/0x86c)
[<c02c2014>] (ubifs_lpt_init) from [<c02aa954>] (ubifs_mount+0xe80/0x1c74)
[<c02aa954>] (ubifs_mount) from [<c01cbc38>] (mount_fs+0xc/0x44)
[<c01cbc38>] (mount_fs) from [<c01e1cd8>] (vfs_kern_mount+0x4c/0xf4)
[<c01e1cd8>] (vfs_kern_mount) from [<c01e4ea0>] (do_mount+0x9a4/0xaf0)
[<c01e4ea0>] (do_mount) from [<c01e5218>] (SyS_mount+0x70/0x98)
[<c01e5218>] (SyS_mount) from [<c0107680>] (ret_fast_syscall+0x0/0x3c)
UBIFS (ubi0:0): background thread "ubifs_bgt0_0" stops
mount: wrong fs type, bad option, bad superblock on /dev/ubi0_0,
          missing codepage or helper program, or other error

          In some cases useful info is found in syslog - try
          dmesg | tail or so.
#
#
# mtdinfo -a
Count of MTD devices:           2
Present MTD devices:            mtd0, mtd1
Sysfs interface supported:      yes

mtd0
Name:                           qspi-fsbl-uboot
Type:                           nor
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          8 (1048576 bytes, 1024.0 KiB)
Minimum input/output unit size: 1 byte
Sub-page size:                  1 byte
Character device major/minor:   90:0
Bad blocks are allowed:         false
Device is writable:             true

mtd1
Name:                           nv-storage
Type:                           nor
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          248 (32505856 bytes, 31.0 MiB)
Minimum input/output unit size: 1 byte
Sub-page size:                  1 byte
Character device major/minor:   90:2
Bad blocks are allowed:         false
Device is writable:             true
#
#
# ubinfo -a
UBI version:                    1
Count of UBI devices:           1
UBI control device major/minor: 10:58
Present UBI devices:            ubi0

ubi0
Volumes count:                           1
Logical eraseblock size:                 130944 bytes, 127.9 KiB
Total amount of logical eraseblocks:     248 (32474112 bytes, 31.0 MiB)
Amount of available logical eraseblocks: 0 (0 bytes)
Maximum count of volumes                 128
Count of bad physical eraseblocks:       0
Count of reserved physical eraseblocks:  0
Current maximum erase counter value:     4
Minimum input/output unit size:          1 byte
Character device major/minor:            244:0
Present volumes:                         0

Volume ID:   0 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        244 LEBs (31950336 bytes, 30.5 MiB)
State:       OK
Name:        persist
Character device major/minor: 244:1


On 11/03/2016 04:10 AM, Richard Weinberger wrote:
> Naga Sureshkumar Relli,
>
> On 03.11.2016 06:11, Naga Sureshkumar Relli wrote:
>> Hi Richard,
>>
>>>> Hmm, the calculations in lpt.c use basic properties of the MTD (number of blocks, etc...).
>>>> Can you please double check which property causes the failure and also verify whether the MTD driver provides correct properties. i.e. page sizes, block size, number of blocks, ...
>>
>>> Hm, these values depend only on basic MTD prperties AFAICT.
>>> Mtd->numeraseregions = 0
>>> Nor->pagesize = 512
>>
>> As per the above query only, I have given the below inputs.
>>> Maybe you miss some bit and set incorrect MTD properties.
>> I double checked the MTD properties (as mentioned above) which were causing the failure, but didn't find any clue.
>> All mtd properties looks good for dual parallel case(there is no odd value).
>>
>> Is there any impact by putting below logic in do_calc_lpt_geom() ?
>> If(c->pnode_sz % 2)
>>     c->pnode_sz += 1;
>
> Yes, we need to understand first what exactly is going on.
>
>> please suggest me to do any further debugging?
>
> Please find the exact MTD property which causes the odd values.
> Can you also please share the full kernel log of both cases? (dual and non-dual).
> I'm especially interested in the output of UBI.
> I have the feeling that we oversee something.
>
> Thanks,
> //richard
>

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dmesg.txt
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20161117/fbb732c3/attachment-0001.txt>


More information about the linux-mtd mailing list