Skip to content

Commit

Permalink
mtd: mtdoops: skip reading initially bad blocks
Browse files Browse the repository at this point in the history
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: [email protected]
Signed-off-by: Roman Tereshonkov <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
  • Loading branch information
Roman Tereshonkov authored and David Woodhouse committed Jan 9, 2012
1 parent 2f4478c commit 3538c56
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/mtd/mtdoops.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 3538c56

Please sign in to comment.