To expand on what Wookey wrote: YAFFS determines what blocks are bad at scan time (when mounting). If any further blocks go bad during the operation of the device (write errors detected etc), then these blocks are marked for retiring (blk->needsRetiring = 1). Then, when the block gets garbage collected (see yaffs_BlockBecameDirty()), instead of recycling the block (erase for furture use) we mark it dead. Apart from the blocks marked bad during manufacturing, blocks go bad very infrequently. In a recent 150GB write test I saw no blocks go bad. To test the bad block management I hack the NAND emulation layer in YAFFS direct to mimic block failures. If I didn't do this, the bad block handling would never have been tested. -- Charles -----Original Message----- From: yaffs-admin@stoneboat.aleph1.co.uk [mailto:yaffs-admin@stoneboat.aleph1.co.uk] On Behalf Of Abhishek Bhattacharya Sent: Tuesday, 26 October 2004 9:28 p.m. To: yaffs@stoneboat.aleph1.co.uk Subject: [Yaffs] yaffs BAD sector management queries! Hello Charles I have a doubt about BAD sector management. Well, we do a scan for bad blocks at boot up, fine! In your last mail , we came to know that, once you mark it DEAD we never use it again, but if there is a situation where a block becomes BAD at run time, how should we counter such a situation? Thanks Abhishek