> > > > > > > > > + } > > > > > > > > > > > > > > > > > > Here, if the power loss happens before erasing this block, for > > > > > > the next time boot up, What will happen from FS layer in case > > > > > > FS detect this filled > > > > > data? > > > > > > > > > > Most likely ECC errors will be returned, but that doesn't matter > > > > > since this block was about to be erased. You have pretty much > > > > > the same problem for partially erase blocks already, and that > > > > > should be handled by the wear-leveling/FS, if not, that would be > > > > > bug (note that it's properly handled by UBI, which just > > > > > considers the block as invalid and > > > schedules an erase). > > > > > > > > > > > > > Concerning this, I still have question, for the UBIFS, If I am > > > > correct, there are EC and VID header both being damaged, then > > > > UBIFS will re-erase it. I don't know if UBIFS can handle there is > > > > dirty/filling data in the > > > some pages and EC/VID valid. > > > > Maybe Richard has fixed it. > > > > > > If the block is being erased that means there's another one mapped > > > to the same LEB, or the block is simply not needed anymore. In both > > > cases, this old block shouldn't be referenced. Again, if that happens, it's a > bug. > > > > Would you please help us confirm this? how does ubifs handle this > > situation? Also other FS? Eg, jffs2, yaffs > > > > And if you're really worried about that, forcibly writing all pages starting from 0 > should do the trick. But I don't think that's needed. > As I said, when you trigger an erase, you're not guaranteed the erase will > complete before a potential power-cut, meaning that part of your data might > still be valid, while others could be corrupted. Boris I think, this patch wasn't fully tested on the system. This patch inevitably lengthen the erase time. As long going into this function, from the software point, it is erasing operation. And from physical side, it is not. Thanks, Bean ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/