[Yaffs] Yaffs cannot create a file after a full disk

Brad Beveridge bbeveridge@bluewatersys.com
Mon, 09 Aug 2004 16:14:18 +1200


Hi all, I have managed to get Yaffs going on 2.6.7 with MTD.  Thank for 
the help Nick & Zhonglin.  I've run into my next problem, if I full the 
disk up by copying a large file until the cp fails, then erase that file 
- I don't seem to free up any chunks.
I have a 16MB disk, after copying a > 16MB file to the disk & rm'ing it 
/proc/yaffs is
Device yaffs
startBlock......... 1
endBlock........... 1023
chunkGroupBits..... 0
chunkGroupSize..... 1
nErasedBlocks...... 4
nTnodesCreated..... 2200
nFreeTnodes........ 2199
nObjectsCreated.... 100
nFreeObjects....... 96
nFreeChunks........ 224
nPageWrites........ 4
nPageReads......... 64
nBlockErasures..... 0
nGCCopies.......... 0
garbageCollections. 2
passiveGCs......... 0
nRetriedWrites..... 0
nRetireBlocks...... 2
eccFixed........... 0
eccUnfixed......... 0
tagsEccFixed....... 0
tagsEccUnfixed..... 5
cacheHits.......... 0
nDeletedFiles...... 1
nUnlinkedFiles..... 1
nBackgroudDeletions 0
useNANDECC......... 1

Trying to copy another (smaller) file in gives me
lart #cp /bin/busybox /mnt/yaffs/
yaffs_mknod: making oject for busybox, mode 81ed dev 0
cp: unable to open `/mnt/yaffs/busybox': Cannot allocate memory

With dmesg output of
<snip>
**>>Block 59 marked for retirement
**>>ecc error unfixed on chunk 1919:0
**>>ecc error unfixed on chunk 1919:1
**>>Block 59 marked for retirement
**>> Block 59 retired
yaffs_mknod failed making object
yaffs unlocking

It's as if Yaffs isn't garbage collecting properly, although everytime I 
attempt to copy to the disk the garbageCollections field in /proc/yaffs 
does increase.  Hmm, so does the nRetireBlocks....  Is Yaffs trying to 
erase a block and failing?  The mtd utility flasherase_all does erase 
all the blocks.  If I erase the blocks under yaffs while it is mounted I 
get the same results.  If I umount & remount yaffs, it works fine again. 
I can't see why this should be.  Any thoughts?

Cheers
Brad