[Yaffs] *****SPAM***** abuout yaffs2_CheckpointErase() mark …

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
Delete this message
Reply to this message
Author: vkim
Date:  
To: yaffs
Subject: [Yaffs] *****SPAM***** abuout yaffs2_CheckpointErase() mark bad block
Hi guys:



Currently, if an error happens when yaffs2_CheckpointErase() erases a block,
The wrong address is used to mark the bad block, I think that it is a bug ,
Fix this by subtracting the proper block offset from the address. the code is as follows:




--- a/fs/yaffs2/yaffs_checkptrw.c
+++ b/fs/yaffs2/yaffs_checkptrw.c
@@ -47,7 +47,7 @@ static int yaffs2_CheckpointErase(yaffs_Device *dev)
                                if (dev->param.eraseBlockInNAND(dev, i - dev->blockOffset /* realign */)) {
                                dev->nErasedBlocks++;
                                dev->nFreeChunks += dev->param.nChunksPerBlock;
                        } else {
-                               dev->param.markNANDBlockBad(dev, i);
+                               dev->param.markNANDBlockBad(dev, i - dev->blockOffset);
                                bi->blockState = YAFFS_BLOCK_STATE_DEAD;
                        }
                }




Thanks
senk