* [PATCH] mtdoops: skip reading initially bad blocks
@ 2011-12-02 13:07 Roman Tereshonkov
2011-12-04 14:24 ` Artem Bityutskiy
0 siblings, 1 reply; 2+ messages in thread
From: Roman Tereshonkov @ 2011-12-02 13:07 UTC (permalink / raw)
To: linux-mtd; +Cc: rpurdie, dwmw2, Roman Tereshonkov
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(-)
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,
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mtdoops: skip reading initially bad blocks
2011-12-02 13:07 [PATCH] mtdoops: skip reading initially bad blocks Roman Tereshonkov
@ 2011-12-04 14:24 ` Artem Bityutskiy
0 siblings, 0 replies; 2+ messages in thread
From: Artem Bityutskiy @ 2011-12-04 14:24 UTC (permalink / raw)
To: Roman Tereshonkov; +Cc: dwmw2, rpurdie, linux-mtd
[-- Attachment #1: Type: text/plain, Size: 468 bytes --]
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!
--
Best Regards,
Artem Bityutskiy
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-12-04 14:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-02 13:07 [PATCH] mtdoops: skip reading initially bad blocks Roman Tereshonkov
2011-12-04 14:24 ` Artem Bityutskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).