[Yaffs] adding bad blocks back into a yaffs2 filesystem

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Steven Hein
Date:  
To: yaffs
Subject: [Yaffs] adding bad blocks back into a yaffs2 filesystem
I've had a situation where NAND blocks are being marked bad
invalidly due to a HW/driver issue, and I am trying to recover them.

I've patched the MTD code to allow bad block erase, and I've
the scrounged together a MEMSETGOODBLOCK ioctl patch to
allow bad blocks to be unmarked in the BBT.    All of this is working:
I can erase bad blocks (and verify that data and OOB are all 0xff's),
and I can unmark the blocks bad in the BBT.


When I have a YAFFS2 filesystem that has bad blocks, I use this
sequence to attempt to recover the blocks:

(1) unmount the filesystem
(2) erase the bad blocks
(3) unmark the blocks bad
(4) mount the filesystem

After this sequence, I have found that I have files in the
filesystem that are corrupted or missing, but they were
correct before I started the sequence.


Is this a valid sequence to use? Are there other steps that I need?
Are there inherent issues with re-adding erased blocks back into
a yaffs2 filesystem?

Thanks, Steve