changeset 254:08307f2d7546

Handle unfixed ecc errors better when scanning
author charles
date Fri, 16 Jan 2009 00:44:45 +0000
parents ac67e3d7378b
children 467bb4a77339
files yaffs_guts.c
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/yaffs_guts.c
+++ b/yaffs_guts.c
@@ -11,6 +11,7 @@
  * published by the Free Software Foundation.
  */
 
+
 const char *yaffs_guts_c_version =
     "$Id$";
 
@@ -4363,7 +4364,6 @@ static int yaffs_CheckpointTnodeWorker(y
 			}
 		} else if (level == 0) {
 			__u32 baseOffset = chunkOffset <<  YAFFS_TNODES_LEVEL0_BITS;
-			/* printf("write tnode at %d\n",baseOffset); */
 			ok = (yaffs_CheckpointWrite(dev,&baseOffset,sizeof(baseOffset)) == sizeof(baseOffset));
 			if(ok)
 				ok = (yaffs_CheckpointWrite(dev,tn,tnodeSize) == tnodeSize);
@@ -4412,7 +4412,6 @@ static int yaffs_ReadCheckpointTnodes(ya
 		/* Read level 0 tnode */
 		
 		
-		/* printf("read  tnode at %d\n",baseChunk); */
 		tn = yaffs_GetTnodeRaw(dev);
 		if(tn)
 			ok = (yaffs_CheckpointRead(dev,tn,tnodeSize) == tnodeSize);
@@ -6286,7 +6285,11 @@ static int yaffs_ScanBackwards(yaffs_Dev
 
 				dev->nFreeChunks++;
 				
-			} else if (tags.chunkId > 0) {
+			} else if (tags.eccResult == YAFFS_ECC_RESULT_UNFIXED){
+				printf("Error in ECC\n");
+				/* Don't actually delete because the chunk is not yet set up as being in use */
+				/* yaffs_DeleteChunk(dev, chunk, 1, __LINE__); */
+			}else if (tags.chunkId > 0) {
 				/* chunkId > 0 so it is a data chunk... */
 				unsigned int endpos;
 				__u32 chunkBase =