Message ID | 1322831237-22044-1-git-send-email-roman.tereshonkov@nokia.com |
---|---|
State | Accepted |
Commit | 3538c56329936c78f7d356889908790006d0124c |
Headers | show |
On Fri, 2011-12-02 at 15:07 +0200, Roman Tereshonkov wrote: > 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 <roman.tereshonkov@nokia.com> Looks like a candidate for the stable tree as it fixes a bad bug. I've added Cc: stable@kernel.org and pushed to l2-mtd-2.6.git, thanks!
diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c index 1e2fa62..cea9279 100644 --- a/drivers/mtd/mtdoops.c +++ b/drivers/mtd/mtdoops.c @@ -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,
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 <roman.tereshonkov@nokia.com> --- drivers/mtd/mtdoops.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)