hi,
I have a linux 2.6.36 with yaffs and patches from openwrt.
The yaffs is mounted as upper in overlayfs.
So far so good.
Things appear ok as long as I simply remove files with rm (unlink).
Once I try to move (rename) the file where there is already an
existing file, the space occupied by existing file is not reclaimed.
get some content into test1
$ cp test1 test2
$ mv test2 test1
I put kprintf all over the place and enabled yaffs log (+os). As far
as I can tell, the yaffs_rename is called and it does the job in terms
of yaffs. However the yaffs_evict_inode is not called after, so the
chunks are never deleted.
Rebooting brings the lost blocks back. I assume things get cleaned up
during mount.
Perhaps someone recalls this issue from 2.6 days and can give me a hint.
At the moment I am looking at d_move_locked which is most likely not
interacting well with yaffs_rename.
So far I tried:
1. flushing the directory cache with:
echo 2 > /proc/sys/vm/drop_caches
which calls evict_inode on a lot of entries but not the one in question.
2. Check that the kernel calls evict_inode when I do the same operation on FAT.
3. Look at git log of yaffs for a hint of a fix.
cheers,
--pawel