I have the same problem. I enable YAFFS_TRACE_ALLOCATE, YAFFS_TRACE_GC and YAFFS_TRACE_GC_DETAIL this time. I also capture /proc/yaffs before and after copying file. There are already some bad blocks marked by the last run. It is noticed that there is a soft lockup in the middle. The log is below. # cat /proc/yaffs YAFFS built:Nov 23 2006 11:50:15 $Id: yaffs_fs.c,v 1.54 2006/10/24 18:09:15 charles Exp $ $Id: yaffs_guts.c,v 1.45 2006/11/14 03:07:17 charles Exp $ # flash_eraseall /dev/mtd5 Skipping bad block at 0x00000000 Erasing 128 Kibyte @ 20000 -- 0 % complete. Skipping bad block at 0x00040000 Skipping bad block at 0x00060000 ............ Skipping bad block at 0x00340000 Skipping bad block at 0x00360000 Erasing 128 Kibyte @ 7e80000 -- 99 % complete. # mount -t yaffs2 /dev/mtdblock5 /yaffs2 [42949509.130000] yaffs: dev is 32505861 name is "mtdblock5" [42949509.130000] yaffs: Attempting MTD mount on 31.5, "mtdblock5" [42949509.180000] block 1 is bad [42949509.180000] block 3 is bad ...........[42949509.260000] block 27 is bad [42949509.270000] block 28 is bad # cat /proc/yaffsYAFFS built:Nov 23 2006 11:50:15 $Id: yaffs_fs.c,v 1.54 2006/10/24 18:09:15 charles Exp $ $Id: yaffs_guts.c,v 1.45 2006/11/14 03:07:17 charles Exp $ Device 0 "File system" startBlock......... 0 endBlock........... 1012 chunkGroupBits..... 0 chunkGroupSize..... 1 nErasedBlocks...... 986 nTnodesCreated..... 0 nFreeTnodes........ 0 nObjectsCreated.... 200 nFreeObjects....... 96 nFreeChunks........ 63104 nPageWrites........ 0 nPageReads......... 0 nBlockErasures..... 0 nGCCopies.......... 0 garbageCollections. 0 passiveGCs......... 0 nRetriedWrites..... 0 nRetireBlocks...... 0 eccFixed........... 0 eccUnfixed......... 0 tagsEccFixed....... 0 tagsEccUnfixed..... 0 cacheHits.......... 0 nDeletedFiles...... 0 nUnlinkedFiles..... 0 nBackgroudDeletions 0 useNANDECC......... 1 isYaffs2........... 1# dd if=test_file of=/yaffs2/test_file [42949586.060000] yaffs: Tnodes added [42949586.070000] Allocated block 2, seq 4097, 985 left [42949586.080000] **>> Block 2 needs retiring [42949586.080000] yaffs_BlockBecameDirty block 2 state 5 needs retiring [42949586.090000] **>> Block 2 retired [42949586.090000] Allocated block 29, seq 4098, 984 left [42949586.100000] **>> Block 29 needs retiring [42949586.100000] yaffs_BlockBecameDirty block 29 state 5 needs retiring [42949586.110000] **>> Block 29 retired [42949586.110000] Allocated block 30, seq 4099, 983 left [42949586.120000] **>> Block 30 needs retiring [42949586.130000] yaffs_BlockBecameDirty block 30 state 5 needs retiring [42949586.130000] **>> Block 30 retired [42949586.140000] Allocated block 31, seq 4100, 982 left ............... [42949595.250000] **>> Block 425 needs retiring [42949595.250000] yaffs_BlockBecameDirty block 425 state 5 needs retiring [42949595.260000] **>> Block 425 retired [42949595.260000] Allocated block 426, seq 4495, 587 left [42949595.270000] **>> Block 426 needs retiring [42949595.270000] yaffs_BlockBecameDirty block 426 state 5 needs retiring [42949595.280000] **>> Block 426 retired [42949595.290000] Allocated block 427, seq 4496, 586 left [42949595.290000] **>> Block 427 needs retiring [42949595.300000] BUG: soft lockup detected on CPU#0! [42949595.300000] [42949595.300000] Pid: 227, comm: dd [42949595.300000] CPU: 0 [42949595.300000] PC is at release_console_sem+0xb0/0x224 [42949595.300000] LR is at release_console_sem+0xac/0x224 [42949595.300000] pc : [] lr : [] Not tainted [42949595.300000] sp : c3817b30 ip : 0001a8bf fp : c3817b5c [42949595.300000] r10: c02cd49c r9 : c02cd498 r8 : fffe5741 [42949595.300000] r7 : c026a664 r6 : 60000013 r5 : 0001a8bf r4 : 0001a8bf [42949595.300000] r3 : c02cd084 r2 : c0278870 r1 : 0001a8bf r0 : 0001a8bf [42949595.300000] Flags: nZCv IRQs on FIQs on Mode SVC_32 Segment user [42949595.300000] Control: C5387F Table: 83848000 DAC: 00000015 [42949595.300000] [] (show_regs+0x0/0x50) from [] (softlock)[42949595.300000] r5 = C02EE824 [42949595.300000] [] (softlockup_tick+0x0/0x84) from [] (do)[42949595.300000] r4 = 00000000 [42949595.300000] [] (do_timer+0x0/0x514) from [] (timer_ti)[42949595.300000] [] (timer_tick+0x0/0xf8) from [] (omap2_g)[42949595.300000] r6 = 00000026 r5 = C3817AE8 r4 = C02ED7D0 [42949595.300000] [] (omap2_gp_timer_interrupt+0x0/0x7c) from [] (__do_irq+0x0/0xfc) from [] (do_level_)[42949595.300000] r8 = C3817AE8 r7 = C0265C88 r6 = C3817AE8 r5 = 00000026 [42949595.300000] r4 = C02C7A7C [42949595.300000] [] (do_level_IRQ+0x0/0xc4) from [] (asm_d)[42949595.300000] r6 = 60000013 r5 = D80FE000 r4 = C3816000 [42949595.300000] [] (asm_do_IRQ+0x0/0x154) from [] (__irq_)[42949595.300000] [] (release_console_sem+0x0/0x224) from [)[42949595.300000] [] (vprintk+0x0/0x330) from [] (printk+0x)[42949595.300000] [] (printk+0x0/0x24) from [] (yaffs_Write)[42949595.300000] r3 = 40001055 r2 = 0000000F r1 = 000001AB r0 = C0238270 [42949595.300000] [] (yaffs_WriteNewChunkWithTagsToNAND+0x0/0x560) fr)[42949595.300000] [] (yaffs_UpdateObjectHeader+0x0/0x3a8) from [] (yaffs_MknodObject+0x0/0x16c) from [] )[42949595.300000] [] (yaffs_MknodFile+0x0/0x50) from [] (ya)[42949595.300000] r4 = C38440F8 [42949595.300000] [] (yaffs_mknod+0x0/0x2b4) from [] (yaffs)[42949595.300000] [] (yaffs_create+0x0/0x6c) from [] (vfs_c)[42949595.300000] r6 = C3D0E6D0 r5 = 000001A4 r4 = 00000000 [42949595.300000] [] (vfs_create+0x0/0xbc) from [] (open_na)[42949595.300000] r8 = C3820EE8 r7 = 00000242 r6 = C3820BB8 r5 = C3817F00 [42949595.300000] r4 = C3820BB8 [42949595.300000] [] (open_namei+0x0/0x570) from [] (filp_o)[42949595.300000] [] (filp_open+0x0/0xa0) from [] (do_sys_o)[42949595.300000] r8 = C00252A8 r7 = C3FDD000 r6 = 000001B6 r5 = 00000004 [42949595.300000] r4 = 00000241 [42949595.300000] [] (do_sys_open+0x0/0xf0) from [] (sys_op)[42949595.300000] [] (sys_open+0x0/0x14) from [] (ret_fast_)[42949595.310000] yaffs_BlockBecameDirty block 427 state 5 needs retiring [42949595.320000] **>> Block 427 retired [42949595.320000] Allocated block 428, seq 4497, 585 left [42949595.330000] **>> Block 428 needs retiring [42949595.330000] yaffs_BlockBecameDirty block 428 state 5 needs retiring [42949595.340000] **>> Block 428 retired ............ [42949608.540000] **>> Block 998 retired [42949608.540000] Allocated block 999, seq 5068, 14 left [42949608.550000] **>> yaffs write required 971 attempts dd: /yaffs2/test_file: Cannot allocate memory # cat /proc/yaffs YAFFS built:Nov 23 2006 11:50:15 $Id: yaffs_fs.c,v 1.54 2006/10/24 18:09:15 charles Exp $ $Id: yaffs_guts.c,v 1.45 2006/11/14 03:07:17 charles Exp $ Device 0 "File system" startBlock......... 0 endBlock........... 1012 chunkGroupBits..... 0 chunkGroupSize..... 1 nErasedBlocks...... 14 nTnodesCreated..... 100 nFreeTnodes........ 100 nObjectsCreated.... 200 nFreeObjects....... 96 nFreeChunks........ 960 nPageWrites........ 0 nPageReads......... 0 nBlockErasures..... 0 nGCCopies.......... 0 garbageCollections. 0 passiveGCs......... 0 nRetriedWrites..... 970 nRetireBlocks...... 971 eccFixed........... 0 eccUnfixed......... 0 tagsEccFixed....... 0 tagsEccUnfixed..... 0 cacheHits.......... 0 nDeletedFiles...... 0 nUnlinkedFiles..... 1 nBackgroudDeletions 0 useNANDECC......... 1 isYaffs2........... 1 # umount /yaffs2 Charles Manning wrote: On Tuesday 24 October 2006 16:27, Paul Wang wrote: > Hi, > > Thanks for your valuable answer. > Yes, I forget to erase the mtdblock first. > > After I used "mkyaffs" to erase the block, It shows from /proc/yaffs that > nEraseblocks is 815. I can write some files without the errors. > > Then I got another problem, after I write some files(the total blocksize is > 13M and I write around 5M data), the nEraseblock went down to 0 and I got > the same error message again. Even I delete some files and the nEraseblock > is always 0. > That means the flash is not fully released. > > How to do the garbage collection? > How can my application know when to do the garbage collection? The garbage collection is done automatically by yaffgs as a by-product of any operation that modifies the file system. It seems to me that one of two things has happened here: 1) Garbage collection triggering is broken somehow, so yaffs does not triger garbage collection. 2) The garbage collection is failing because the erasure is failing or some simil;ar problem. Thsi means that attempts to do garbage collection do not free up any space. Try turning on tracing for YAFFS_TRACE_ALLOCATE, YAFFS_TRACE_GC and YAFFS_TRACE_GC_DETAIL. These should give a far better indication of what is happening. > > Regards > Paul > ----- Original Message ----- > From: "Charles Manning" > To: > Cc: "Paul Wang" ; ; > ; ; Sent: Tuesday, > October 24, 2006 8:23 AM > Subject: Re: [Yaffs] yaffs problem: !!!!!!!!! Allocator out > !!!!!!!!!!!!!!!!! > > On Sunday 22 October 2006 03:56, Paul Wang wrote: > > Hello, > > > > Sorry to disturb, I saw you discussed this problem last month. > > Is there any solution? > > > > I meet this problem and have no idea what to do. > > Currently I'm using Linux 2.6.12. > > And it's a 32M nand flash with 3 mtdbolcks. > > first 3M bytes reserved > > following 16M bytes file system(cramfs) > > last 13M bytes yaffs > > > > I can see it reports few bad blocks for the yaffs. > > I always get this error message > > ----------------- > > yaffs tragedy: no more eraased blocks > > !!!!!!!!! Allocator out !!!!!!!!!!!!!!!!! > > This happens because you have no erased blocks to use for further > allocation. > > > --------------------- > > And what I did is just using VI to edit a file(no more than 30 bytes). > > > > I have attached the /proc/yaffs file and the message during linux start > > up. > > From the /proc/yaffs > > nErasedBlocks...... 0 > > What you don't say is when you captured the /proc/yaffs and how you got the > system into this state. > > There should never be fewer than about 5 erased blocks. > > Can you do the following: > > 1) Erase partition > 2) Mount > 3) capture /proc/yaffs and output from ls -ial > 4) Do whatever it is you do to get into this state. With some explanation. > 5) capture /proc/yaffs. > > > Thanx > > -- Charles _______________________________________________ yaffs mailing list yaffs@lists.aleph1.co.uk http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs --------------------------------- Access over 1 million songs - Yahoo! Music Unlimited.