diff options
author | Roman Tereshonkov <roman.tereshonkov@nokia.com> | 2011-12-02 08:07:17 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-01-09 13:12:47 -0500 |
commit | 3538c56329936c78f7d356889908790006d0124c (patch) | |
tree | fdbbe58414a31b2a8101f948ac3022c3e1ecc2c7 /drivers/mtd | |
parent | 2f4478ccff7df845dc9c0f8996a96373122c4417 (diff) |
mtd: 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.
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>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/mtdoops.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c index 1e2fa623670..cea9279ceab 100644 --- a/drivers/mtd/mtdoops.c +++ b/drivers/mtd/mtdoops.c | |||
@@ -253,6 +253,9 @@ static void find_next_position(struct mtdoops_context *cxt) | |||
253 | size_t retlen; | 253 | size_t retlen; |
254 | 254 | ||
255 | for (page = 0; page < cxt->oops_pages; page++) { | 255 | for (page = 0; page < cxt->oops_pages; page++) { |
256 | if (mtd->block_isbad && | ||
257 | mtd->block_isbad(mtd, page * record_size)) | ||
258 | continue; | ||
256 | /* Assume the page is used */ | 259 | /* Assume the page is used */ |
257 | mark_page_used(cxt, page); | 260 | mark_page_used(cxt, page); |
258 | ret = mtd->read(mtd, page * record_size, MTDOOPS_HEADER_SIZE, | 261 | ret = mtd->read(mtd, page * record_size, MTDOOPS_HEADER_SIZE, |