#if 0
if ((parent == dev->deletedDir ||
parent == dev->unlinkedDir)) {
/* If it is unlinked at start up then it wants deleting */
in->deleted = 1;
}
#endif
if (oh->isShrink) {
/* Mark the block as having a shrinkHeader */
bi->hasShrinkHeader = 1;
}
.......
Setting in->deleted to 1 here does not have much sense at least if this objects is in unlinked list. If you do that than the object gonna have both "unlinked" and "deleted" flags set and yaffs_DestroyObject does nothing to reclaim space. If you modify this code as directed then all files in "unlinked" state will be moved in "deleted" state after scan complete and they will be reclaimed at garbage collection time.
I am not sure that this is a proper fix though, it might be a treatment for symptom and not the cause. I would like to have some feedback from guys who really understand what is going on here.
M.