nanddump runs forever when it tries to dump a partition which has bad block

jemicheng . jemicheng at gmail.com
Tue Jul 8 03:50:23 UTC 2014


Thanks for the information.
The test result is good after applying this patch.

Thanks,


2014-07-03 23:14 GMT+08:00 Baruch Siach <baruch at tkos.co.il>:

> Hi jemicheng,
>
> On Thu, Jul 03, 2014 at 11:06:08PM +0800, jemicheng . wrote:
> > After I trace the nandwrite.c for this problem, I found that the program
> > runs into a function dump_bad.
> > Here is a snippet of the dump_bad function.
> >
> > static void dump_bad(struct mtd_info_user *meminfo, unsigned len, int
> oob)
> > {
> >     unsigned char buf[meminfo->writesize];
> >     unsigned count;
> >
> >     /* round len to the next page */
> >     len = (len | ~(meminfo->writesize - 1)) + 1;
> >
> >
> > The value of len is 131072 and meminfo->writesize is 2048
> > After the round len calculation, the len becomes 4294965249
> >
> > My partition is only 5MB but nanddump tries to write almost 4GB for the
> > dumped image.
> >
> > Is something wrong with the dump_bad function or is there something else
> > wrong?
>
> This should be fixed by
>
> http://git.busybox.net/busybox/commit/?id=cbf3bfa57a419202c2bc26f3ff8ae21d3d3bf8b2
> .
> Please try current Busybox master, or apply this patch to your version, and
> report back.
>
> baruch
>
> --
>      http://baruch.siach.name/blog/                  ~. .~   Tk Open
> Systems
> =}------------------------------------------------ooO--U--Ooo------------{=
>    - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20140708/4e7fb42c/attachment.html>


More information about the busybox mailing list