Hi,
 
There is a bug in YAFFS2 in GC implementation.
 
While checking the block, whether its qualified for GC(in the function yaffs_BlockNotDisqualifiedFromGC), we are supposed to find the oldest dirty sequence number. But in the present implementation, we are finding only the oldest sequence number.
 
Hence, it needs to be changed to find the oldest dirty sequence number as under.
 
Current Implementation
--------------------------------
"if (b->blockState == YAFFS_BLOCK_STATE_FULL && (b->pagesInUse - b->softDeletions) < dev->nChunksPerBlock && b->sequenceNumber < seq)"
 
Required Implementation(To find Oldest Dirty Sequence Number)
-----------------------------------------------------------------------------------------
"if (b->blockState == YAFFS_BLOCK_STATE_FULL && (b->pagesInUse - b->softDeletions) <= (bi->pagesInUse - bi->softDeletions) && b->sequenceNumber < seq)"
 
After disk is been used for long time(multiple usages), even if the disk has the valid Block for the GC having sequence number newer than the oldest sequence number, then this block is not qualified for GC(with Current Implementation). This also leads to poor write performance...
 
I have tested with the modified implementation, and is working consistantly fine with proper disk usage and also with improved write performance.
 
Hope this makes sense...
 
Regards,
Asif

-------------------------------------------------------DISCLAIMER------------------------------------------------------
The information transmitted herewith is confidential and proprietary information intended only for use by the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer.
--------------------------------------------------------------------------------------------------------------------------------

Please do not print this email unless it is absolutely necessary. Spread environmental awareness.