How does JFFS2 handle a block going bad in NAND flash ?
If an error occurs when writing to a page, JFFS2 will attempt recovery of the data. If the block contains nodes that have already been written to flash, the block is refiled onto the list of blocks that are bad but still in use (the bad_used_list). Then the write buffer itself is recovered. This takes into account any data that has been partially written to flash. Once the write buffer has been recovered, normal operation continues. Garbage collection is responsible for moving the valid nodes from the block that was refiled. Once garbage collection has written all of the valid nodes to a different eraseblock, the block is moved to the erase pending list. From there JFFS2 will erase the eraseblock. If the erase failed, it is put on the erase pending list again for a retry. If the erase fails at the device level a total of three times, it is marked as bad in the OOB area and filed onto the bad_block_list. If the erase succeeds, a clean marker is written to the OOB area and the block is f
Related Questions
- What would Maitreya say about the belief that there is a conspiracy theory that there are bad guys out there as well as good guys going round in spaceships?
- I’m checking my disk with chkdsk or scandisk and they are reporting bads, but MHDD does not see any bad block. What happened?
- How bad is fatigue actually going to be?