yaffs Fix incorrect handling of deletion flag
[yaffs2.git] / yaffs_mtdif2.c
index 2b5884715a0f9e6a218fd5a7ebc5a901d5e26d86..c1d447819970e7ccab5a81bc0e7b576ae807b233 100644 (file)
@@ -179,8 +179,14 @@ int nandmtd2_ReadChunkWithTagsFromNAND(yaffs_Device *dev, int chunkInNAND,
        if (localData)
                yaffs_ReleaseTempBuffer(dev, data, __LINE__);
 
-       if (tags && retval == -EBADMSG && tags->eccResult == YAFFS_ECC_RESULT_NO_ERROR)
+       if (tags && retval == -EBADMSG && tags->eccResult == YAFFS_ECC_RESULT_NO_ERROR) {
                tags->eccResult = YAFFS_ECC_RESULT_UNFIXED;
+               dev->eccUnfixed++;
+       }
+       if(tags && retval == -EUCLEAN && tags->eccResult == YAFFS_ECC_RESULT_NO_ERROR) {
+               tags->eccResult = YAFFS_ECC_RESULT_FIXED;
+               dev->eccFixed++;
+       }
        if (retval == 0)
                return YAFFS_OK;
        else