Bad blocks while attaching UBIFS
Artem Bityutskiy
dedekind1 at gmail.com
Thu Nov 7 06:04:56 EST 2013
On Wed, 2013-11-06 at 13:35 -0200, Fernando Silveira wrote:
> Hi,
>
> I'm using an yet unreleased NAND flash controller with my own MTD
> driver and everything is working perfectly except for one thing: after
> a few weeks UBIFS begins to throw some error messages while attaching
> and a few days later it just doesn't attach anymore. I know bad blocks
> are supposed to appear after rewriting lots of data but it seems to me
> that UBIFS is not marking the "attach" blocks as bad nor wear leveling
> the "attach/info" sector. The error message follows below:
>
> UBI: attaching mtd3 to ubi0
> UBI: physical eraseblock size: 2097152 bytes (2048 KiB)
> UBI: logical eraseblock size: 2080768 bytes
> UBI: smallest flash I/O unit: 8192
> UBI: VID header offset: 8192 (aligned 8192)
> UBI: data offset: 16384
> [my mtd driver printing error messages while trying to read a block]
> UBI error: ubi_io_read: error -5 while reading 64 bytes from PEB
> 3394:0, read 0 bytes
>
> Note that once a UBIFS file system starts to fail, that PEB indicated
> in the "ubi_io_read" error seems to never change. I'll take a closer
> look at this detail if I see more errors.
>
> My questions are:
>
> 1. Does UBIFS mark a bad block when it is failing to attach?
UBI marks eraseblocks as bad when it cannot write or erase. And blocks
are not marked a s bad right away. Instead, they are first "tortured",
and if the torture test fails, then the eraseblock is marked as bad.
> 2. If yes, what might be wrong with my driver?
Does it handle short reads properly? Please, run mtd tests to validate
your driver.
--
Best Regards,
Artem Bityutskiy
More information about the linux-mtd
mailing list