Hi folks My apologies for not addressing this sooner, it got a bit lost in the Christmas rush. I have tested this and applied this patch to CVS. Thanx Mikhail. -- Charles On Wednesday 21 December 2005 09:11, Mikhail Ryleev wrote: > Hi, all > > It looks like statfs call reports incorrect amount of free space available > on device. It is off by the number of "deleted" but "uncollected" by > garbage collector files on device which can be signifficant in certain > cases. Such files belongs to "deleted" directory and while the amount of > space occupiend by data in such files is acounted as free, the entry in > directory is NOT. > > The proposed fix does two things: > > 1: nDeletedFiles variable would correctly count the number of "deleted" > but uncollected files > 2: the number of free blocks is adjusted by that value. > > > --- ./old/yaffs_guts.c 2005-12-19 20:02:18.000000000 -0800 > +++ ./yaffs_guts.c 2005-12-20 11:54:58.000000000 -0800 > @@ -2346,6 +2346,7 @@ > ("yaffs: About to finally delete object %d" > TENDSTR), object->objectId)); > yaffs_DoGenericObjectDeletion(object); > + object->myDev->nDeletedFiles--; > } > > } > @@ -5690,6 +5691,8 @@ > nFree = yaffs_CountFreeChunks(dev); > #endif > > + nFree += dev->nDeletedFiles; > + > /* Now count the number of dirty chunks in the cache and subtract those > */ > > {