Fix provided by James McKenzie for yaffs_DeleteChunk() - read before write
authoraleph1 <aleph1>
Fri, 29 Aug 2003 17:53:05 +0000 (17:53 +0000)
committeraleph1 <aleph1>
Fri, 29 Aug 2003 17:53:05 +0000 (17:53 +0000)
needed

yaffs_guts.c

index 7afb1406a444114a9081c1d66d5b6f4af7145389..365fa69636622e601a951a111d0b313808721863 100644 (file)
@@ -14,7 +14,7 @@
  */
  //yaffs_guts.c
 
-const char *yaffs_guts_c_version="$Id: yaffs_guts.c,v 1.28 2003-08-20 03:53:39 charles Exp $";
+const char *yaffs_guts_c_version="$Id: yaffs_guts.c,v 1.29 2003-08-29 17:53:05 aleph1 Exp $";
 
 #include "yportenv.h"
 
@@ -2863,6 +2863,10 @@ static void yaffs_DeleteChunk(yaffs_Device *dev,int chunkId,int markNAND)
        if(markNAND)
        {
                yaffs_SpareInitialise(&spare);
+
+                //read data before write, to ensure correct ecc 
+                //and transitions are guaranteed 1->0
+                yaffs_ReadChunkFromNAND(dev,chunkId,NULL,&spare,0);
        
                spare.pageStatus = 0; // To mark it as deleted.