mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
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>
This commit is contained in:
parent
2f4478ccff
commit
3538c56329
1 changed files with 3 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue