2009/12/16 Charles Manning : > On Wednesday 16 December 2009 16:36:02 JiSheng Zhang wrote: >> 2009/12/16 JiSheng Zhang : >> > Hi list, >> > >> > First mount an empty partition, then cp some files to the mnt dir then >> > run "df", and then delete all the files, then run "df" again. df >> > report this time is wrong. It seems that the chunks occupied by >> > unlinked files aren't recycled until needed. >> > >> > Is this a bug or characteristic? > > I don't see that problem. > > root@linux-dual-head:/opt/y/cvs/yaffs2# mount -t yaffs2 /dev/mtdblock0 /mnt > root@linux-dual-head:/opt/y/cvs/yaffs2# df > Filesystem           1K-blocks      Used Available Use% Mounted on > /dev/mtdblock0           65536      1152     64384   2% /mnt > root@linux-dual-head:/opt/y/cvs/yaffs2# cp * /mnt > root@linux-dual-head:/opt/y/cvs/yaffs2# df > Filesystem           1K-blocks      Used Available Use% Mounted on > /dev/mtdblock0           65536      5860     59676   9% /mnt > root@linux-dual-head:/opt/y/cvs/yaffs2# rm /mnt/* > root@linux-dual-head:/opt/y/cvs/yaffs2# df > Filesystem           1K-blocks      Used Available Use% Mounted on > /dev/mtdblock0           65536      1156     64380   2% /mnt > > If you can make a test case then I would like to see it please. > I made a mistake. I redo the test steps, found that there's no problem with df on yaffs2. >> >> I think I found where the problem was. in revision 1.62 of >> yaffs_guts.c yaffs_ResizeFile(in, 0); is added at the beginning of >> function yaffs_DeleteFile(). Could someone give an explanation? > > The Resize was done because this removed the need for SoftDelete. Doing it > this way makes the garbage collection faster. > Thanks for you explanation. Best Regard, Jisheng