<div>I see exactly the same problem, and I think the bug is in yaffs_ScanBackwards routine. </div>
<div> </div>
<div>The solution that I have at this point is to delete the following lines in yaffs_ScanBackwards routine:</div>
<div> </div>
<div>.......</div>
<div> yaffs_AddObjectToDirectory(parent, in);</div>
<div>
<p>#if 0 <br> if ((parent == dev->deletedDir ||<br> parent == dev->unlinkedDir)) {<br> /* If it is unlinked at start up then it wants deleting */<br> in->deleted = 1;<br> }<br>#endif
</p>
<p> if (oh->isShrink) {<br> /* Mark the block as having a shrinkHeader */<br> bi->hasShrinkHeader = 1;<br> }<br>.......</p>
<p>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.
</p>
<p>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. </p>
<p>M. </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> <br></p>
<p> </p>
<p> </p></div>