On 6 November 2011 08:12, Diego <elc...@kde.org> wrote: > Hi list, > > I am trying to debug this problem in a system I am developing: > > at some point I need to write a number to a file, and then reboot via an > external device the machine. That device will cut of the power for a > moment, > and the machine will power on again (this is to overcome a fault we could > not > overcome otherwise). Before the reboot, I "umount" the proper partition and > then "sync". > > For some reason, on one machine we see that the data is not updated and the > original data is kept in the file. I konw empirically that if I add a > "sleep(5)" after the umount, and before the "reboot" the data is written to > the disk. >
Disk write cache without battery backup is the first thing that comes to mind. Check your disk's specifications and how to control the cache. > Any tips how to debug this? > * the system is a TI 2.6.32 kernel (OMAP) > * the data is saved using fopen() > * disk is umounted using system("umount /data"), and then I call from C to > sync(); > Why not a direct umount(2) call? --Amos
_______________________________________________ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il