On Tue, Feb 28, 2006 at 02:45:00PM +0200, Artis Kugevics wrote: ... > Index: yaffs_guts.c > =================================================================== > --- yaffs_guts.c (revision 5760) > +++ yaffs_guts.c (working copy) > @@ -409,6 +409,8 @@ > /* First check this chunk is erased... */ > #ifndef CONFIG_YAFFS_DISABLE_CHUNK_ERASED_CHECK > writeOk = yaffs_CheckChunkErased(dev, chunk); > +#else > + writeOk = 1; > #endif > if (!writeOk) { > T(YAFFS_TRACE_ERROR, Nathan Roberts also reported the above problem (failed write retires all remaining good blocks when CONFIG_YAFFS_DISABLE_CHUNK_ERASED_CHECK is set). The above or the following alternate is suggested for yaffs2 CVS. -- Todd Index: yaffs_guts.c =================================================================== RCS file: /home/aleph1/cvs/yaffs2/yaffs_guts.c,v retrieving revision 1.30 diff -u -r1.30 yaffs_guts.c --- yaffs_guts.c 1 Mar 2006 08:14:32 -0000 1.30 +++ yaffs_guts.c 6 Mar 2006 20:29:09 -0000 @@ -406,20 +406,19 @@ if (chunk >= 0) { - /* First check this chunk is erased... */ #ifndef CONFIG_YAFFS_DISABLE_CHUNK_ERASED_CHECK + /* First check this chunk is erased... */ writeOk = yaffs_CheckChunkErased(dev, chunk); -#endif if (!writeOk) { T(YAFFS_TRACE_ERROR, (TSTR ("**>> yaffs chunk %d was not erased" TENDSTR), chunk)); - } else { + } else +#endif writeOk = yaffs_WriteChunkWithTagsToNAND(dev, chunk, data, tags); - } attempts++; if (writeOk) {