All of lore.kernel.org
 help / color / mirror / Atom feed
* Fail to mount cloned disk image with fastmap.
@ 2013-08-15 13:29 Bill Pringlemeir
  2013-08-15 18:23 ` Bill Pringlemeir
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Bill Pringlemeir @ 2013-08-15 13:29 UTC (permalink / raw)
  To: linux-mtd


I have back-ported the fastmap code from the 3.0 series to a 2.6.36
kernel on an ARM cpu.  It has been running for some time without issue
and the boot time is reduced by 1/2 second.  I just ran a test over
night with 'pppd' capturing packets and likely filled up the disk.

It appears that my kernel does not boot, so I made a clone of the disk
and then attempt to mount it on my Ubuntu machine with the following,

  modprobe nandsim first_id_byte=0x2c second_id_byte=0xda \
    third_id_byte=0x90 fourth_id_byte=0x95 parts=2,64,64
  flash_erase /dev/mtd3 0 0
  ubiformat /dev/mtd3 -f rootfs.ubi
  modprobe ubi mtd=3 fm_autoconvert=0

Actually at first, I did not specify the 'fm_autoconvert'.  In both
case, the 'modprobe' of the UBI fails with the 3.8 Ubuntu kernel.  I
though that if I specify 'fm_autoconvert=0', none of the 'fastmap' code
should be active?  Should I re-compile without MTD_UBI_FASTMAP to see if
I can mount the file system?  I would like to be able to look at the
file system, even in read-only mode.  The kernel logs are below from the
'ubi' modprobe.  Is there actually an issue here with UBI?  When I try
to mount the 'ubi' partition with,

 mount -t ubifs -o ro /dev/ubi0_3 /mnt/ubifs

additional issues are encountered.  But I think that some of the UBI
issues might be a problem?  Can I use some other flash with a bigger
size so that 'PEBs' can be reserved?

Of course, I have the disk image and can send additional information.

Thanks,
Bill Pringlemeir.

[1232060.158586] ubi: `0' invalid for parameter `ubi.fm_autoconvert'
[1232069.536856] ubi: `0' invalid for parameter `fm_autoconvert_bla'
[1232073.333755] UBI: default fastmap pool size: 95
[1232073.333761] UBI: default fastmap WL pool size: 25
[1232073.333765] UBI: attaching mtd3 to ubi0
[1232073.339804] ------------[ cut here ]------------
[1232073.339814] WARNING: at /build/buildd/linux-3.8.0/drivers/mtd/ubi/fastmap.c:827 ubi_attach_fastmap+0x9b9/0xb50 [ubi]()
[1232073.339815] Hardware name: 421511U
[1232073.339816] Modules linked in: ubi(+) deflate(F) zlib_deflate(F) mtdchar nandsim nand nand_ecc nand_bch bch(F) nand_ids mtd romfs nfnetlink(F) arc4(F) md4(F) nls_utf8 cif
s(F) fscache(F) parport_pc(F) ppdev(F) rfcomm bnep bluetooth binfmt_misc(F) dm_crypt(F) coretemp kvm cdc_subset cdc_eem usbnet snd_hda_codec_realtek snd_hda_intel snd_hda_code
c snd_hwdep(F) snd_pcm(F) snd_page_alloc(F) snd_seq_midi(F) snd_seq_midi_event(F) snd_rawmidi(F) snd_seq(F) gpio_ich snd_seq_device(F) snd_timer(F) mac_hid snd(F) nvidia(POF) wmi soundcore(F) psmouse(F) lpc_ich mei serio_raw(F) lp(F) microcode(F) parport(F) hid_generic ghash_clmulni_intel(F) aesni_intel(F) aes_x86_64(F) xts(F) lrw(F) gf128mul(F) ablk_helper(F) cryptd(F) usbhid hid firewire_ohci 3c59x firewire_core crc_itu_t(F) e1000e(F) [last unloaded: ubi]
[1232073.339854] Pid: 9420, comm: modprobe Tainted: PF       W  O 3.8.0-27-generic #40-Ubuntu
[1232073.339855] Call Trace:
[1232073.339860]  [<ffffffff810587ef>] warn_slowpath_common+0x7f/0xc0
[1232073.339862]  [<ffffffff8105884a>] warn_slowpath_null+0x1a/0x20
[1232073.339866]  [<ffffffffa0f271e9>] ubi_attach_fastmap+0x9b9/0xb50 [ubi]
[1232073.339870]  [<ffffffffa0f27801>] ubi_scan_fastmap+0x441/0x7b0 [ubi]
[1232073.339874]  [<ffffffffa0f24102>] scan_fast+0x192/0x1b0 [ubi]
[1232073.339878]  [<ffffffffa0f248b0>] ubi_attach+0x120/0x240 [ubi]
[1232073.339882]  [<ffffffffa0f17886>] ubi_attach_mtd_dev+0x766/0xe90 [ubi]
[1232073.339886]  [<ffffffffa0e386cd>] ? __get_mtd_device+0x1d/0x80 [mtd]
[1232073.339889]  [<ffffffffa0f3744c>] ubi_init+0x226/0xdda [ubi]
[1232073.339893]  [<ffffffffa0f37226>] ? ubi_mtd_param_parse+0x226/0x226 [ubi]
[1232073.339896]  [<ffffffff8100215a>] do_one_initcall+0x12a/0x180
[1232073.339900]  [<ffffffff810c0127>] load_module+0x10c7/0x1520
[1232073.339902]  [<ffffffff810bba20>] ? unset_module_init_ro_nx+0x80/0x80
[1232073.339904]  [<ffffffff810c0645>] sys_init_module+0xc5/0xf0
[1232073.339907]  [<ffffffff816d521d>] system_call_fastpath+0x1a/0x1f
[1232073.339908] ---[ end trace f20e309ad7ab2d28 ]---
[1232073.339909] UBI error: ubi_scan_fastmap: Attach by fastmap failed, doing a full scan!
[1232073.344416] UBI: scanning is finished
[1232073.344751] UBI assert failed in ubi_wl_init at 1968 (pid 9420)
[1232073.344753] Pid: 9420, comm: modprobe Tainted: PF       W  O 3.8.0-27-generic #40-Ubuntu
[1232073.344754] Call Trace:
[1232073.344764]  [<ffffffffa0f2231e>] ubi_wl_init+0x62e/0x660 [ubi]
[1232073.344768]  [<ffffffffa0f2490b>] ubi_attach+0x17b/0x240 [ubi]
[1232073.344772]  [<ffffffffa0f17886>] ubi_attach_mtd_dev+0x766/0xe90 [ubi]
[1232073.344777]  [<ffffffffa0e386cd>] ? __get_mtd_device+0x1d/0x80 [mtd]
[1232073.344780]  [<ffffffffa0f3744c>] ubi_init+0x226/0xdda [ubi]
[1232073.344783]  [<ffffffffa0f37226>] ? ubi_mtd_param_parse+0x226/0x226 [ubi]
[1232073.344787]  [<ffffffff8100215a>] do_one_initcall+0x12a/0x180
[1232073.344792]  [<ffffffff810c0127>] load_module+0x10c7/0x1520
[1232073.344794]  [<ffffffff810bba20>] ? unset_module_init_ro_nx+0x80/0x80
[1232073.344796]  [<ffffffff810c0645>] sys_init_module+0xc5/0xf0
[1232073.344799]  [<ffffffff816d521d>] system_call_fastpath+0x1a/0x1f
[1232073.344818] UBI warning: print_rsvd_warning: cannot reserve enough PEBs for bad PEB handling, reserved 21, need 40
[1232073.345224] UBI: attached mtd3 (name "NAND simulator partition 3", size 239 MiB) to ubi0
[1232073.345228] UBI: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes
[1232073.345231] UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 512

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Fail to mount cloned disk image with fastmap.
  2013-08-15 13:29 Fail to mount cloned disk image with fastmap Bill Pringlemeir
@ 2013-08-15 18:23 ` Bill Pringlemeir
  2013-08-15 20:55 ` richard -rw- weinberger
  2013-08-15 21:16 ` richard -rw- weinberger
  2 siblings, 0 replies; 6+ messages in thread
From: Bill Pringlemeir @ 2013-08-15 18:23 UTC (permalink / raw)
  To: linux-mtd

On 15 Aug 2013, bpringlemeir@nbsps.com wrote:

> I have back-ported the fastmap code from the 3.0 series to a 2.6.36
> kernel on an ARM cpu.  It has been running for some time without issue
> and the boot time is reduced by 1/2 second.  I just ran a test over
> night with 'pppd' capturing packets and likely filled up the disk.
>
> It appears that my kernel does not boot, so I made a clone of the disk
> and then attempt to mount it on my Ubuntu machine,

[snip]

> The 'modprobe' of the UBI fails with the 3.8 Ubuntu kernel.  Should I
> re-compile without MTD_UBI_FASTMAP to see if I can mount the file
> system?  I would like to be able to look at the file system, even in
> read-only mode.  The kernel logs are below from the 'ubi' modprobe.
> Is there actually an issue here with UBI? But I think that some of the
> UBI issues might be a problem?  Can I use some other flash with a
> bigger size so that 'PEBs' can be reserved?

I remounted the Ubuntu machine with nandsim and only used a single
partition.  This gets rid of the 'print_rsvd_warning'.  However, the
image still can not be mounted on the PC with ubifs (UBI has fast map).

I recompiled my Linux 2.6.36 without Linux and used a 'nandwrite' and
'tftp' from an initramfs to reproduce the image on another device.  The
2.6.36 patched kernel mount it after correcting some errors.  However,
as the 'bad blocks' are different between devices, I may have missed
some data and this made it work.

Fwiw,
Bill Pringlemeir.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Fail to mount cloned disk image with fastmap.
  2013-08-15 13:29 Fail to mount cloned disk image with fastmap Bill Pringlemeir
  2013-08-15 18:23 ` Bill Pringlemeir
@ 2013-08-15 20:55 ` richard -rw- weinberger
  2013-08-16 19:46   ` Bill Pringlemeir
  2013-08-15 21:16 ` richard -rw- weinberger
  2 siblings, 1 reply; 6+ messages in thread
From: richard -rw- weinberger @ 2013-08-15 20:55 UTC (permalink / raw)
  To: Bill Pringlemeir; +Cc: linux-mtd

On Thu, Aug 15, 2013 at 3:29 PM, Bill Pringlemeir
<bpringlemeir@nbsps.com> wrote:
>
> I have back-ported the fastmap code from the 3.0 series to a 2.6.36
> kernel on an ARM cpu.  It has been running for some time without issue
> and the boot time is reduced by 1/2 second.  I just ran a test over
> night with 'pppd' capturing packets and likely filled up the disk.
>
> It appears that my kernel does not boot, so I made a clone of the disk
> and then attempt to mount it on my Ubuntu machine with the following,
>
>   modprobe nandsim first_id_byte=0x2c second_id_byte=0xda \
>     third_id_byte=0x90 fourth_id_byte=0x95 parts=2,64,64
>   flash_erase /dev/mtd3 0 0
>   ubiformat /dev/mtd3 -f rootfs.ubi
>   modprobe ubi mtd=3 fm_autoconvert=0
>
> Actually at first, I did not specify the 'fm_autoconvert'.  In both
> case, the 'modprobe' of the UBI fails with the 3.8 Ubuntu kernel.  I
> though that if I specify 'fm_autoconvert=0', none of the 'fastmap' code
> should be active?  Should I re-compile without MTD_UBI_FASTMAP to see if
> I can mount the file system?  I would like to be able to look at the
> file system, even in read-only mode.  The kernel logs are below from the
> 'ubi' modprobe.  Is there actually an issue here with UBI?  When I try
> to mount the 'ubi' partition with,

fm_autoconvert=0 tells UBI to use the fastmap if one is found but
not to automatically convert non-fastmap images to fastmap.

Yes, please try to attach the image with MTD_UBI_FASTMAP=n.

>  mount -t ubifs -o ro /dev/ubi0_3 /mnt/ubifs
>
> additional issues are encountered.  But I think that some of the UBI
> issues might be a problem?  Can I use some other flash with a bigger
> size so that 'PEBs' can be reserved?
>
> Of course, I have the disk image and can send additional information.

Can you please upload the image somewhere where I can analyze it?

> Thanks,
> Bill Pringlemeir.
>
> [1232060.158586] ubi: `0' invalid for parameter `ubi.fm_autoconvert'
> [1232069.536856] ubi: `0' invalid for parameter `fm_autoconvert_bla'
> [1232073.333755] UBI: default fastmap pool size: 95
> [1232073.333761] UBI: default fastmap WL pool size: 25
> [1232073.333765] UBI: attaching mtd3 to ubi0
> [1232073.339804] ------------[ cut here ]------------
> [1232073.339814] WARNING: at /build/buildd/linux-3.8.0/drivers/mtd/ubi/fastmap.c:827 ubi_attach_fastmap+0x9b9/0xb50 [ubi]()

That is:

        /*
         * If fastmap is leaking PEBs (must not happen), raise a
         * fat warning and fall back to scanning mode.
         * We do this here because in ubi_wl_init() it's too late
         * and we cannot fall back to scanning.
         */
        if (WARN_ON(count_fastmap_pebs(ai) != ubi->peb_count -
                    ai->bad_peb_count - fm->used_blocks))
                goto fail_bad;

> [1232073.339815] Hardware name: 421511U
> [1232073.339816] Modules linked in: ubi(+) deflate(F) zlib_deflate(F) mtdchar nandsim nand nand_ecc nand_bch bch(F) nand_ids mtd romfs nfnetlink(F) arc4(F) md4(F) nls_utf8 cif
> s(F) fscache(F) parport_pc(F) ppdev(F) rfcomm bnep bluetooth binfmt_misc(F) dm_crypt(F) coretemp kvm cdc_subset cdc_eem usbnet snd_hda_codec_realtek snd_hda_intel snd_hda_code
> c snd_hwdep(F) snd_pcm(F) snd_page_alloc(F) snd_seq_midi(F) snd_seq_midi_event(F) snd_rawmidi(F) snd_seq(F) gpio_ich snd_seq_device(F) snd_timer(F) mac_hid snd(F) nvidia(POF) wmi soundcore(F) psmouse(F) lpc_ich mei serio_raw(F) lp(F) microcode(F) parport(F) hid_generic ghash_clmulni_intel(F) aesni_intel(F) aes_x86_64(F) xts(F) lrw(F) gf128mul(F) ablk_helper(F) cryptd(F) usbhid hid firewire_ohci 3c59x firewire_core crc_itu_t(F) e1000e(F) [last unloaded: ubi]
> [1232073.339854] Pid: 9420, comm: modprobe Tainted: PF       W  O 3.8.0-27-generic #40-Ubuntu
> [1232073.339855] Call Trace:
> [1232073.339860]  [<ffffffff810587ef>] warn_slowpath_common+0x7f/0xc0
> [1232073.339862]  [<ffffffff8105884a>] warn_slowpath_null+0x1a/0x20
> [1232073.339866]  [<ffffffffa0f271e9>] ubi_attach_fastmap+0x9b9/0xb50 [ubi]
> [1232073.339870]  [<ffffffffa0f27801>] ubi_scan_fastmap+0x441/0x7b0 [ubi]
> [1232073.339874]  [<ffffffffa0f24102>] scan_fast+0x192/0x1b0 [ubi]
> [1232073.339878]  [<ffffffffa0f248b0>] ubi_attach+0x120/0x240 [ubi]
> [1232073.339882]  [<ffffffffa0f17886>] ubi_attach_mtd_dev+0x766/0xe90 [ubi]
> [1232073.339886]  [<ffffffffa0e386cd>] ? __get_mtd_device+0x1d/0x80 [mtd]
> [1232073.339889]  [<ffffffffa0f3744c>] ubi_init+0x226/0xdda [ubi]
> [1232073.339893]  [<ffffffffa0f37226>] ? ubi_mtd_param_parse+0x226/0x226 [ubi]
> [1232073.339896]  [<ffffffff8100215a>] do_one_initcall+0x12a/0x180
> [1232073.339900]  [<ffffffff810c0127>] load_module+0x10c7/0x1520
> [1232073.339902]  [<ffffffff810bba20>] ? unset_module_init_ro_nx+0x80/0x80
> [1232073.339904]  [<ffffffff810c0645>] sys_init_module+0xc5/0xf0
> [1232073.339907]  [<ffffffff816d521d>] system_call_fastpath+0x1a/0x1f
> [1232073.339908] ---[ end trace f20e309ad7ab2d28 ]---
> [1232073.339909] UBI error: ubi_scan_fastmap: Attach by fastmap failed, doing a full scan!
> [1232073.344416] UBI: scanning is finished
> [1232073.344751] UBI assert failed in ubi_wl_init at 1968 (pid 9420)
> [1232073.344753] Pid: 9420, comm: modprobe Tainted: PF       W  O 3.8.0-27-generic #40-Ubuntu
> [1232073.344754] Call Trace:
> [1232073.344764]  [<ffffffffa0f2231e>] ubi_wl_init+0x62e/0x660 [ubi]
> [1232073.344768]  [<ffffffffa0f2490b>] ubi_attach+0x17b/0x240 [ubi]
> [1232073.344772]  [<ffffffffa0f17886>] ubi_attach_mtd_dev+0x766/0xe90 [ubi]
> [1232073.344777]  [<ffffffffa0e386cd>] ? __get_mtd_device+0x1d/0x80 [mtd]
> [1232073.344780]  [<ffffffffa0f3744c>] ubi_init+0x226/0xdda [ubi]
> [1232073.344783]  [<ffffffffa0f37226>] ? ubi_mtd_param_parse+0x226/0x226 [ubi]
> [1232073.344787]  [<ffffffff8100215a>] do_one_initcall+0x12a/0x180
> [1232073.344792]  [<ffffffff810c0127>] load_module+0x10c7/0x1520
> [1232073.344794]  [<ffffffff810bba20>] ? unset_module_init_ro_nx+0x80/0x80
> [1232073.344796]  [<ffffffff810c0645>] sys_init_module+0xc5/0xf0
> [1232073.344799]  [<ffffffff816d521d>] system_call_fastpath+0x1a/0x1f
> [1232073.344818] UBI warning: print_rsvd_warning: cannot reserve enough PEBs for bad PEB handling, reserved 21, need 40

Hmm, this may explain why the above WARN_ON() triggers.
Something is fishy here.

-- 
Thanks,
//richard

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Fail to mount cloned disk image with fastmap.
  2013-08-15 13:29 Fail to mount cloned disk image with fastmap Bill Pringlemeir
  2013-08-15 18:23 ` Bill Pringlemeir
  2013-08-15 20:55 ` richard -rw- weinberger
@ 2013-08-15 21:16 ` richard -rw- weinberger
  2 siblings, 0 replies; 6+ messages in thread
From: richard -rw- weinberger @ 2013-08-15 21:16 UTC (permalink / raw)
  To: Bill Pringlemeir; +Cc: linux-mtd

On Thu, Aug 15, 2013 at 3:29 PM, Bill Pringlemeir
<bpringlemeir@nbsps.com> wrote:
>
> I have back-ported the fastmap code from the 3.0 series to a 2.6.36
> kernel on an ARM cpu.  It has been running for some time without issue
> and the boot time is reduced by 1/2 second.  I just ran a test over
> night with 'pppd' capturing packets and likely filled up the disk.
>
> It appears that my kernel does not boot, so I made a clone of the disk
> and then attempt to mount it on my Ubuntu machine with the following,

BTW: What exactly does "my kernel does not boot" mean?
Does it also fail at the said WARN_ON()?

The WARN_ON() can also trigger if made the image in a wrong way.
A truncated image would explain both error messages.

>   modprobe nandsim first_id_byte=0x2c second_id_byte=0xda \
>     third_id_byte=0x90 fourth_id_byte=0x95 parts=2,64,64
>   flash_erase /dev/mtd3 0 0
>   ubiformat /dev/mtd3 -f rootfs.ubi
>   modprobe ubi mtd=3 fm_autoconvert=0
>
> Actually at first, I did not specify the 'fm_autoconvert'.  In both
> case, the 'modprobe' of the UBI fails with the 3.8 Ubuntu kernel.  I
> though that if I specify 'fm_autoconvert=0', none of the 'fastmap' code
> should be active?  Should I re-compile without MTD_UBI_FASTMAP to see if
> I can mount the file system?  I would like to be able to look at the
> file system, even in read-only mode.  The kernel logs are below from the
> 'ubi' modprobe.  Is there actually an issue here with UBI?  When I try
> to mount the 'ubi' partition with,
>
>  mount -t ubifs -o ro /dev/ubi0_3 /mnt/ubifs
>
> additional issues are encountered.  But I think that some of the UBI
> issues might be a problem?  Can I use some other flash with a bigger
> size so that 'PEBs' can be reserved?
>
> Of course, I have the disk image and can send additional information.
>
> Thanks,
> Bill Pringlemeir.
>
> [1232060.158586] ubi: `0' invalid for parameter `ubi.fm_autoconvert'
> [1232069.536856] ubi: `0' invalid for parameter `fm_autoconvert_bla'
> [1232073.333755] UBI: default fastmap pool size: 95
> [1232073.333761] UBI: default fastmap WL pool size: 25
> [1232073.333765] UBI: attaching mtd3 to ubi0
> [1232073.339804] ------------[ cut here ]------------
> [1232073.339814] WARNING: at /build/buildd/linux-3.8.0/drivers/mtd/ubi/fastmap.c:827 ubi_attach_fastmap+0x9b9/0xb50 [ubi]()
> [1232073.339815] Hardware name: 421511U
> [1232073.339816] Modules linked in: ubi(+) deflate(F) zlib_deflate(F) mtdchar nandsim nand nand_ecc nand_bch bch(F) nand_ids mtd romfs nfnetlink(F) arc4(F) md4(F) nls_utf8 cif
> s(F) fscache(F) parport_pc(F) ppdev(F) rfcomm bnep bluetooth binfmt_misc(F) dm_crypt(F) coretemp kvm cdc_subset cdc_eem usbnet snd_hda_codec_realtek snd_hda_intel snd_hda_code
> c snd_hwdep(F) snd_pcm(F) snd_page_alloc(F) snd_seq_midi(F) snd_seq_midi_event(F) snd_rawmidi(F) snd_seq(F) gpio_ich snd_seq_device(F) snd_timer(F) mac_hid snd(F) nvidia(POF) wmi soundcore(F) psmouse(F) lpc_ich mei serio_raw(F) lp(F) microcode(F) parport(F) hid_generic ghash_clmulni_intel(F) aesni_intel(F) aes_x86_64(F) xts(F) lrw(F) gf128mul(F) ablk_helper(F) cryptd(F) usbhid hid firewire_ohci 3c59x firewire_core crc_itu_t(F) e1000e(F) [last unloaded: ubi]
> [1232073.339854] Pid: 9420, comm: modprobe Tainted: PF       W  O 3.8.0-27-generic #40-Ubuntu
> [1232073.339855] Call Trace:
> [1232073.339860]  [<ffffffff810587ef>] warn_slowpath_common+0x7f/0xc0
> [1232073.339862]  [<ffffffff8105884a>] warn_slowpath_null+0x1a/0x20
> [1232073.339866]  [<ffffffffa0f271e9>] ubi_attach_fastmap+0x9b9/0xb50 [ubi]
> [1232073.339870]  [<ffffffffa0f27801>] ubi_scan_fastmap+0x441/0x7b0 [ubi]
> [1232073.339874]  [<ffffffffa0f24102>] scan_fast+0x192/0x1b0 [ubi]
> [1232073.339878]  [<ffffffffa0f248b0>] ubi_attach+0x120/0x240 [ubi]
> [1232073.339882]  [<ffffffffa0f17886>] ubi_attach_mtd_dev+0x766/0xe90 [ubi]
> [1232073.339886]  [<ffffffffa0e386cd>] ? __get_mtd_device+0x1d/0x80 [mtd]
> [1232073.339889]  [<ffffffffa0f3744c>] ubi_init+0x226/0xdda [ubi]
> [1232073.339893]  [<ffffffffa0f37226>] ? ubi_mtd_param_parse+0x226/0x226 [ubi]
> [1232073.339896]  [<ffffffff8100215a>] do_one_initcall+0x12a/0x180
> [1232073.339900]  [<ffffffff810c0127>] load_module+0x10c7/0x1520
> [1232073.339902]  [<ffffffff810bba20>] ? unset_module_init_ro_nx+0x80/0x80
> [1232073.339904]  [<ffffffff810c0645>] sys_init_module+0xc5/0xf0
> [1232073.339907]  [<ffffffff816d521d>] system_call_fastpath+0x1a/0x1f
> [1232073.339908] ---[ end trace f20e309ad7ab2d28 ]---
> [1232073.339909] UBI error: ubi_scan_fastmap: Attach by fastmap failed, doing a full scan!
> [1232073.344416] UBI: scanning is finished
> [1232073.344751] UBI assert failed in ubi_wl_init at 1968 (pid 9420)
> [1232073.344753] Pid: 9420, comm: modprobe Tainted: PF       W  O 3.8.0-27-generic #40-Ubuntu
> [1232073.344754] Call Trace:
> [1232073.344764]  [<ffffffffa0f2231e>] ubi_wl_init+0x62e/0x660 [ubi]
> [1232073.344768]  [<ffffffffa0f2490b>] ubi_attach+0x17b/0x240 [ubi]
> [1232073.344772]  [<ffffffffa0f17886>] ubi_attach_mtd_dev+0x766/0xe90 [ubi]
> [1232073.344777]  [<ffffffffa0e386cd>] ? __get_mtd_device+0x1d/0x80 [mtd]
> [1232073.344780]  [<ffffffffa0f3744c>] ubi_init+0x226/0xdda [ubi]
> [1232073.344783]  [<ffffffffa0f37226>] ? ubi_mtd_param_parse+0x226/0x226 [ubi]
> [1232073.344787]  [<ffffffff8100215a>] do_one_initcall+0x12a/0x180
> [1232073.344792]  [<ffffffff810c0127>] load_module+0x10c7/0x1520
> [1232073.344794]  [<ffffffff810bba20>] ? unset_module_init_ro_nx+0x80/0x80
> [1232073.344796]  [<ffffffff810c0645>] sys_init_module+0xc5/0xf0
> [1232073.344799]  [<ffffffff816d521d>] system_call_fastpath+0x1a/0x1f
> [1232073.344818] UBI warning: print_rsvd_warning: cannot reserve enough PEBs for bad PEB handling, reserved 21, need 40
> [1232073.345224] UBI: attached mtd3 (name "NAND simulator partition 3", size 239 MiB) to ubi0
> [1232073.345228] UBI: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes
> [1232073.345231] UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 512
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/



-- 
Thanks,
//richard

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Fail to mount cloned disk image with fastmap.
  2013-08-15 20:55 ` richard -rw- weinberger
@ 2013-08-16 19:46   ` Bill Pringlemeir
  2013-08-16 19:59     ` Richard Weinberger
  0 siblings, 1 reply; 6+ messages in thread
From: Bill Pringlemeir @ 2013-08-16 19:46 UTC (permalink / raw)
  To: richard -rw- weinberger; +Cc: linux-mtd

On 15 Aug 2013, richard.weinberger@gmail.com wrote:

> On Thu, Aug 15, 2013 at 3:29 PM, Bill Pringlemeir wrote:

>> I have back-ported the fastmap code from the 3.0 series to a 2.6.36
>> kernel on an ARM cpu.  It has been running for some time without issue
>> and the boot time is reduced by 1/2 second.  I just ran a test over
>> night with 'pppd' capturing packets and likely filled up the disk.
>>
>> It appears that my kernel does not boot, so I made a clone of the disk
>> and then attempt to mount it on my Ubuntu machine with the following,

> BTW: What exactly does "my kernel does not boot" mean?
> Does it also fail at the said WARN_ON()?

> The WARN_ON() can also trigger if made the image in a wrong way.
> A truncated image would explain both error messages.

Unfortunately, the device where this occurs does not have a serial port
for a console.  So, the boot sequence stops.  My guess was/is that it
just can not mount the 'UbiFS rootfs'; just like trying to mount it on
the 3.8 nandsim doesn't work.

> fm_autoconvert=0 tells UBI to use the fastmap if one is found but
> not to automatically convert non-fastmap images to fastmap.

I thought of this right after 'send'.  At one point there was a '0,1,2'
value that could disable fastmap?  This must have been a different
parameter and I think it has been removed.

> Yes, please try to attach the image with MTD_UBI_FASTMAP=n.

With no changes to 'mtd3', the non-fast map version seems to boot fine.
There is some of the initial kernel logs below.  The 'UbiFs' performed a
'recovery' as well.

>> additional issues are encountered.  But I think that some of the UBI
>> issues might be a problem?  Can I use some other flash with a bigger
>> size so that 'PEBs' can be reserved?

>> Of course, I have the disk image and can send additional information.

> Can you please upload the image somewhere where I can analyze it?

Is there a program to extract the UBI headers?  I can send the data, but
I will have to look through it for some time to make sure there is
nothing I shouldn't give out; downloaded data files, etc. which is
probably a trival amount of the total image.

I will be away for 2 weeks.  It was back ported code and I have just
disabled 'fastmap' for now.  Are you interested in why the more current
code has issues?  Or has someone else reported a similar issue?  The
nand flash controller was an imx25 and I have the NAND driver updates
to,

   commit 657f28f8811c92724db10d18bbbec70d540147d6
   mtd: kill MTD_NAND_VERIFY_WRITE

I can not take the infra-structure changes, only the chipset bug fixes
as we are stuck at 2.6.36 for now.

Thanks,
Bill Pringlemeir.

[    1.650000] UBI: attaching mtd3 to ubi0
[    1.650000] UBI DBG (pid 1): ubi_attach_mtd_dev: sizeof(struct ubi_ainf_peb) 48
[    1.650000] UBI DBG (pid 1): ubi_attach_mtd_dev: sizeof(struct ubi_wl_entry) 20
[    1.650000] UBI DBG (pid 1): io_init: min_io_size      2048
[    1.650000] UBI DBG (pid 1): io_init: max_write_size   2048
[    1.650000] UBI DBG (pid 1): io_init: hdrs_min_io_size 512
[    1.650000] UBI DBG (pid 1): io_init: ec_hdr_alsize    512
[    1.650000] UBI DBG (pid 1): io_init: vid_hdr_alsize   512
[    1.650000] UBI DBG (pid 1): io_init: vid_hdr_offset   512
[    1.650000] UBI DBG (pid 1): io_init: vid_hdr_aloffset 512
[    1.650000] UBI DBG (pid 1): io_init: vid_hdr_shift    0
[    1.650000] UBI DBG (pid 1): io_init: leb_start        2048
[    1.650000] UBI DBG (pid 1): io_init: max_erroneous    191
[    1.650000] UBI: physical eraseblock size:   131072 bytes (128 KiB)
[    1.660000] UBI: logical eraseblock size:    129024 bytes
[    1.670000] UBI: smallest flash I/O unit:    2048
[    1.670000] UBI: sub-page size:              512
[    1.680000] UBI: VID header offset:          512 (aligned 512)
[    1.690000] UBI: data offset:                2048
[    2.640000] UBI DBG (pid 1): scan_all: scanning is finished
[    2.640000] UBI: max. sequence number:       9141
[    2.800000] UBI: attached mtd3 to ubi0
[    2.800000] UBI: MTD device name:            "root"
[    2.800000] UBI: MTD device size:            239 MiB
[    2.800000] UBI: number of good PEBs:        1914
[    2.800000] UBI: number of bad PEBs:         4
[    2.800000] UBI: number of corrupted PEBs:   0
[    2.800000] UBI: max. allowed volumes:       128
[    2.800000] UBI: wear-leveling threshold:    4096
[    2.800000] UBI: number of internal volumes: 1
[    2.800000] UBI: number of user volumes:     1
[    2.800000] UBI: available PEBs:             0
[    2.810000] UBI: total number of reserved PEBs: 1914
[    2.820000] UBI: number of PEBs reserved for bad PEB handling: 19
[    2.830000] UBI: max/mean erase counter: 51/5
[    2.840000] UBI: image sequence number:  739038085
[    2.850000] UBI: background thread "ubi_bgt0d" started, PID 189
[    2.870000] Freeing init memory: 1176K
[    3.520000] UBIFS: background thread "ubifs_bgt0_3" started, PID 212
[    3.560000] UBIFS: recovery needed
[    3.770000] UBIFS: recovery completed
[    3.770000] UBIFS: mounted UBI device 0, volume 3, name "rootfs"
[    3.770000] UBIFS: LEB size: 129024 bytes (126 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[    3.770000] UBIFS: FS size: 242565120 bytes (231 MiB, 1880 LEBs), journal size 9033728 bytes (8 MiB, 71 LEBs)
[    3.770000] UBIFS: reserved for root: 4190434 bytes (4092 KiB)
[    3.770000] UBIFS: media format: w4/r0 (latest is w4/r0), UUID 82867E3B-5B71-485C-B911-409531E9DA4B, small LPT model

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Fail to mount cloned disk image with fastmap.
  2013-08-16 19:46   ` Bill Pringlemeir
@ 2013-08-16 19:59     ` Richard Weinberger
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Weinberger @ 2013-08-16 19:59 UTC (permalink / raw)
  To: Bill Pringlemeir; +Cc: richard -rw- weinberger, linux-mtd

Am 16.08.2013 21:46, schrieb Bill Pringlemeir:
> On 15 Aug 2013, richard.weinberger@gmail.com wrote:
> 
>> On Thu, Aug 15, 2013 at 3:29 PM, Bill Pringlemeir wrote:
> 
>>> I have back-ported the fastmap code from the 3.0 series to a 2.6.36
>>> kernel on an ARM cpu.  It has been running for some time without issue
>>> and the boot time is reduced by 1/2 second.  I just ran a test over
>>> night with 'pppd' capturing packets and likely filled up the disk.
>>>
>>> It appears that my kernel does not boot, so I made a clone of the disk
>>> and then attempt to mount it on my Ubuntu machine with the following,
> 
>> BTW: What exactly does "my kernel does not boot" mean?
>> Does it also fail at the said WARN_ON()?
> 
>> The WARN_ON() can also trigger if made the image in a wrong way.
>> A truncated image would explain both error messages.
> 
> Unfortunately, the device where this occurs does not have a serial port
> for a console.  So, the boot sequence stops.  My guess was/is that it
> just can not mount the 'UbiFS rootfs'; just like trying to mount it on
> the 3.8 nandsim doesn't work.

Guessing is not good. We like hard facts. :-)

>> fm_autoconvert=0 tells UBI to use the fastmap if one is found but
>> not to automatically convert non-fastmap images to fastmap.
> 
> I thought of this right after 'send'.  At one point there was a '0,1,2'
> value that could disable fastmap?  This must have been a different
> parameter and I think it has been removed.

Yep.
Now the parameter is a Boolean.
MODULE_PARM_DESC(fm_autoconvert, "Set this parameter to enable fastmap automatically on images without a fastmap.");

>> Yes, please try to attach the image with MTD_UBI_FASTMAP=n.
> 
> With no changes to 'mtd3', the non-fast map version seems to boot fine.
> There is some of the initial kernel logs below.  The 'UbiFs' performed a
> 'recovery' as well.

Now I'm really interested in the image to analyze it.

>>> additional issues are encountered.  But I think that some of the UBI
>>> issues might be a problem?  Can I use some other flash with a bigger
>>> size so that 'PEBs' can be reserved?
> 
>>> Of course, I have the disk image and can send additional information.
> 
>> Can you please upload the image somewhere where I can analyze it?
> 
> Is there a program to extract the UBI headers?  I can send the data, but
> I will have to look through it for some time to make sure there is
> nothing I shouldn't give out; downloaded data files, etc. which is
> probably a trival amount of the total image.

Please no mangled images.
Will send you a private mail in a few minutes.

> I will be away for 2 weeks.  It was back ported code and I have just
> disabled 'fastmap' for now.  Are you interested in why the more current
> code has issues?  Or has someone else reported a similar issue?  The
> nand flash controller was an imx25 and I have the NAND driver updates
> to,

Yes! I'm interested in fastmap issues.
So far fastmap has not much users and as it is an experimental feature
I expect issues. ;)

>    commit 657f28f8811c92724db10d18bbbec70d540147d6
>    mtd: kill MTD_NAND_VERIFY_WRITE
> 
> I can not take the infra-structure changes, only the chipset bug fixes
> as we are stuck at 2.6.36 for now.

Please make sure that your backport works correctly.
Did you run ubi-tests on it?

Thanks,
//richard

> Thanks,
> Bill Pringlemeir.
> 
> [    1.650000] UBI: attaching mtd3 to ubi0
> [    1.650000] UBI DBG (pid 1): ubi_attach_mtd_dev: sizeof(struct ubi_ainf_peb) 48
> [    1.650000] UBI DBG (pid 1): ubi_attach_mtd_dev: sizeof(struct ubi_wl_entry) 20
> [    1.650000] UBI DBG (pid 1): io_init: min_io_size      2048
> [    1.650000] UBI DBG (pid 1): io_init: max_write_size   2048
> [    1.650000] UBI DBG (pid 1): io_init: hdrs_min_io_size 512
> [    1.650000] UBI DBG (pid 1): io_init: ec_hdr_alsize    512
> [    1.650000] UBI DBG (pid 1): io_init: vid_hdr_alsize   512
> [    1.650000] UBI DBG (pid 1): io_init: vid_hdr_offset   512
> [    1.650000] UBI DBG (pid 1): io_init: vid_hdr_aloffset 512
> [    1.650000] UBI DBG (pid 1): io_init: vid_hdr_shift    0
> [    1.650000] UBI DBG (pid 1): io_init: leb_start        2048
> [    1.650000] UBI DBG (pid 1): io_init: max_erroneous    191
> [    1.650000] UBI: physical eraseblock size:   131072 bytes (128 KiB)
> [    1.660000] UBI: logical eraseblock size:    129024 bytes
> [    1.670000] UBI: smallest flash I/O unit:    2048
> [    1.670000] UBI: sub-page size:              512
> [    1.680000] UBI: VID header offset:          512 (aligned 512)
> [    1.690000] UBI: data offset:                2048
> [    2.640000] UBI DBG (pid 1): scan_all: scanning is finished
> [    2.640000] UBI: max. sequence number:       9141
> [    2.800000] UBI: attached mtd3 to ubi0
> [    2.800000] UBI: MTD device name:            "root"
> [    2.800000] UBI: MTD device size:            239 MiB
> [    2.800000] UBI: number of good PEBs:        1914
> [    2.800000] UBI: number of bad PEBs:         4
> [    2.800000] UBI: number of corrupted PEBs:   0
> [    2.800000] UBI: max. allowed volumes:       128
> [    2.800000] UBI: wear-leveling threshold:    4096
> [    2.800000] UBI: number of internal volumes: 1
> [    2.800000] UBI: number of user volumes:     1
> [    2.800000] UBI: available PEBs:             0
> [    2.810000] UBI: total number of reserved PEBs: 1914
> [    2.820000] UBI: number of PEBs reserved for bad PEB handling: 19
> [    2.830000] UBI: max/mean erase counter: 51/5
> [    2.840000] UBI: image sequence number:  739038085
> [    2.850000] UBI: background thread "ubi_bgt0d" started, PID 189
> [    2.870000] Freeing init memory: 1176K
> [    3.520000] UBIFS: background thread "ubifs_bgt0_3" started, PID 212
> [    3.560000] UBIFS: recovery needed
> [    3.770000] UBIFS: recovery completed
> [    3.770000] UBIFS: mounted UBI device 0, volume 3, name "rootfs"
> [    3.770000] UBIFS: LEB size: 129024 bytes (126 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
> [    3.770000] UBIFS: FS size: 242565120 bytes (231 MiB, 1880 LEBs), journal size 9033728 bytes (8 MiB, 71 LEBs)
> [    3.770000] UBIFS: reserved for root: 4190434 bytes (4092 KiB)
> [    3.770000] UBIFS: media format: w4/r0 (latest is w4/r0), UUID 82867E3B-5B71-485C-B911-409531E9DA4B, small LPT model
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-08-16 19:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-15 13:29 Fail to mount cloned disk image with fastmap Bill Pringlemeir
2013-08-15 18:23 ` Bill Pringlemeir
2013-08-15 20:55 ` richard -rw- weinberger
2013-08-16 19:46   ` Bill Pringlemeir
2013-08-16 19:59     ` Richard Weinberger
2013-08-15 21:16 ` richard -rw- weinberger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.