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

jemicheng . jemicheng at gmail.com
Thu Jul 3 15:06:08 UTC 2014


Hi,

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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20140703/c425c8f7/attachment-0001.html>


More information about the busybox mailing list