]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
mtd: mtdoops: skip reading initially bad blocks
authorRoman Tereshonkov <roman.tereshonkov@nokia.com>
Fri, 2 Dec 2011 13:07:17 +0000 (15:07 +0200)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 9 Jan 2012 18:12:47 +0000 (18:12 +0000)
Use block_isbad to check and skip the bad blocks reading.
This will allow to get rid of the read errors if bad blocks
are present initially.

Cc: stable@kernel.org
Signed-off-by: Roman Tereshonkov <roman.tereshonkov@nokia.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/mtdoops.c

index 1e2fa6236705941b9fea37b5f0d5bf4a713e56c7..cea9279ceabf8c9b57a411a54fa17a4ebbde2ce6 100644 (file)
@@ -253,6 +253,9 @@ static void find_next_position(struct mtdoops_context *cxt)
        size_t retlen;
 
        for (page = 0; page < cxt->oops_pages; page++) {
+               if (mtd->block_isbad &&
+                   mtd->block_isbad(mtd, page * record_size))
+                       continue;
                /* Assume the page is used */
                mark_page_used(cxt, page);
                ret = mtd->read(mtd, page * record_size, MTDOOPS_HEADER_SIZE,