hi charles,
 
i use yaffs_direct interface to test the Error Collection under power failure.
my fake test code show below: (yflash_disk size is 16MB)
1、yaffs_StardUp()、yaffs_mount()
2、yaffs_open()、yaffs_write(), write 3MB data to the file, during writing generate a random power failure to make program quit.
3、restart the program, do step 1 again, and open the file to verify the data saved.
4、redo step 1 to 3 for 1000 times. then get the free space use yaffs_getfree(), found the free space become 0.
 
so i think the condition of (eccResult1 || eccResult2) can't ensure the block must be retired. if do that will lost a lot of valid space and make filesystem can't run well.
 
if need, i can refer my test source code for you.
 
thanks,
--linuxsir.h
 
 
 
2009/12/23 hq huang <linuxsir.h@gmail.com>
Hi Lists,

 
in the function yaffs_ReadChunkFromNAND(), you do
if (eccResult1 || eccResult2) {
    yaffs_HandleReadDataError(dev, chunkInNAND);
}
does this means if the data save in chunk did't write correct, Yaffs2 will retire the block?
but we can't ensure whether the block is really broken. and this operation may cause the flash space missing.(ie. power failure when writing data to the chunk, data not write correct and spare data are all 0xff)
 
i have do a test to simulate the random power failure during data writing. the result of the test is Yaffs2's free space become less and less. 

does this a bug of Yaffs2, and how to fixed it.thanks.
 
 
 
Best Regards,
And Merry Christmas for everybody!

 
by linuxsir.h
2009.12.23