mtdoops: skip reading initially bad blocks
PATCH 1/1 mtdoops: skip reading initially bad blocks
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.
Signed-off-by Roman Tereshonkov <[email protected]>
--- drivers/mtd/mtdoops.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/mtd/mtdoops.c +3 -0
@@ -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,
Signature · 1 line
1.7.0.4
Quoted 5 lines · Roman Tereshonkov
Use
block_isbadto check and skip the bad blocks reading. This will allow to get rid of the read errors if bad blocks are present initially.Signed-off-by Roman Tereshonkov <[email protected]>
Looks like a candidate for the stable tree as it fixes a bad bug. I've added
and pushed to l2-mtd-2.6.git, thanks!
Signature · 2 lines
Best Regards, Artem Bityutskiy