On Monday 09 August 2010 19:31:10 Henrik Grindal Bakken wrote: > Henrik Grindal Bakken writes: > > Henrik Grindal Bakken writes: > >> Matthieu CASTET writes: > >>> After adding OS trace to yaffs2, I saw that sync does a call to > >>> yaffs_sync_fs, but it is a nop. > >>> > >>> This mean sync syscall doesn't flush the yaffs2 cache and data it > >>> lost on unclean umount. > >>> > >>> Calling yaffs_FlushEntireDeviceCache in yaffs_sync_fs seems to > >>> make sync working. What do you think of that ? > >> > >> I suffer from the same problem. If a yaffs2 filesystem is merely > >> remounted read-only, and never properly unmounted, I seem to lose > >> data. This only (I think, at least primarily) happens on > >> filesystems that are loopback mounted from files in the yaffs2 > >> filesystem. I'd love to see a fix for sync. > > > > Has anyone been able to look at this problem and the proposed fix > > from Matthieu? > > I'm bringing this up again. > > I'm using yaffs (2) on a NAND flash, and on the yaffs fs, I have among > other files some file system images (ext2), which are > loopback-mounted. If I touch a file on the loopback-mounted image, > sync, then poweroff, the file is lost when the box comes up again. > > I notice that yaffs_sync_fs is no longer a nop, but it apparently > doesn't quite do what I need it to. > > Does anyone have any idea how one could go about attacking this > problem? Hello Hendrik Have you tried enabling tracing to see what is happening? #echo +os >/proc/yaffs I wonder if perhaps the file system syncing order does something like this: # sync: sync yaffs yaffs is now sync'ed sync ext2 yaffs is now dirty again What happens if you sync twice? # sync; sleep 2; sync -- Charles