Thanks Bob for your replay.
My system is an embedded system, so it can be that the final user can
shout-down the system without close it cleanly, for example turning
off the power.
It is a very common mistake, but the final user does not see M$
windows and he thinks that he can shutdown the power without problems.
I think that the yaffs should automatically sync after some time the
user has written some data on the yaffs partition.
I could try to modify the yaffs module to do it, for example with a
timer setting it to 5secs.
After a write, I start a timer.
When the timer becomes 0, I can sync the yaffs, all done in kernel space.
It is strange that something similar is not already implemented in the yaffs.
Thanks
Paolo
On Thu, Sep 17, 2009 at 11:39 AM, Bob Dunlop <
rdunlop@guralp.com> wrote:
> Hi,
>
>> If I write into yaffs2 partition and I use "umount" or "sync" before
>> turn off the power, the successive mount command is very fast (about
>> 0.1sec)
>> If I write into yaffs2 partition and I don't use "umount" or "sync"
>> before turn off the power, the successive mount command is very slow
>> (about 13sec)
>
> I'd say that was expected behaviour. Sync sets a checkpoint flag
> telling the booting system that the filesystem is clean and flushed
> allowing it to skip scanning the entire system for any unsyncronised
> late changes.
>
>> A solution could be to have a background task :
>> while [ 1 ]; do sync; sleep 1; done
>> but obviously it is not good.
>
> The program was called syncd and was common on hard disk based systems
> from the 70s to the 90s. It's probably not a good idea to run it on
> a Flash file system.
>
>
>> Have you got some suggestion ?
>
> Only to shut your system down cleanly and make sure you perform a sync
> late in the system shutdown sequence. Exactly how to do that will
> depend on the software you are running.
>
> We use runit and the last two lines in our system task-shutdown script
> are:
> mount -o remount,ro /
> sync
>
> Systems that use inittab will normally have similar entries in there or
> in a script called from inittab.
>
> --
> Bob Dunlop
> Guralp Systems Limited
> http://www.guralp.com
>