[Yaffs] Lost blocks

Mikhail Ryleev mryleev at gmail.com
Fri Dec 16 23:05:13 GMT 2005


I see exactly the same problem, and I think the bug is in
yaffs_ScanBackwards routine.

The solution that I have at this point is to delete the following lines in
yaffs_ScanBackwards routine:

.......
     yaffs_AddObjectToDirectory(parent, in);

#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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.aleph1.co.uk/pipermail/yaffs/attachments/20051216/f0ad79e7/attachment.html


More information about the yaffs mailing list